From 06aba4d08e6017abed05a3cc3e3bbb49276bc0d1 Mon Sep 17 00:00:00 2001 From: Martin Pitt Date: Thu, 1 Jun 2023 07:43:26 +0200 Subject: [PATCH] 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. --- pkg/lib/python.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/pkg/lib/python.js b/pkg/lib/python.js index c7700a5b4..c2290658a 100644 --- a/pkg/lib/python.js +++ b/pkg/lib/python.js @@ -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")