lib: Avoid `which` in python.js
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.
This commit is contained in:
parent
858f559436
commit
06aba4d08e
|
@ -19,8 +19,7 @@
|
||||||
|
|
||||||
import cockpit from "cockpit";
|
import cockpit from "cockpit";
|
||||||
|
|
||||||
// FIXME: eventually convert all images to python 3
|
const pyinvoke = ["sh", "-ec", "exec $(command -v /usr/libexec/platform-python || command -v python3) -c \"$@\"", "--"];
|
||||||
const pyinvoke = ["sh", "-ec", "exec $(which /usr/libexec/platform-python 2>/dev/null || which python3 2>/dev/null || which python) -c \"$@\"", "--"];
|
|
||||||
|
|
||||||
export function spawn (script_pieces, args, options) {
|
export function spawn (script_pieces, args, options) {
|
||||||
const script = (typeof script_pieces == "string")
|
const script = (typeof script_pieces == "string")
|
||||||
|
|
Loading…
Reference in New Issue