Skip to content

Commit

Permalink
lib: Avoid which in python.js
Browse files Browse the repository at this point in the history
This isn't installed everywhere any more. Use `command -v`.

Also drop the long-obsolete check for `python`, all our images have
Python 3 now.
  • Loading branch information
martinpitt committed Jun 1, 2023
1 parent 858f559 commit 06aba4d
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions pkg/lib/python.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,7 @@

import cockpit from "cockpit";

// FIXME: eventually convert all images to python 3
const pyinvoke = ["sh", "-ec", "exec $(which /usr/libexec/platform-python 2>/dev/null || which python3 2>/dev/null || which python) -c \"$@\"", "--"];
const pyinvoke = ["sh", "-ec", "exec $(command -v /usr/libexec/platform-python || command -v python3) -c \"$@\"", "--"];

export function spawn (script_pieces, args, options) {
const script = (typeof script_pieces == "string")
Expand Down

0 comments on commit 06aba4d

Please sign in to comment.