From b661d00acc24c15d121c8d60d150d78c5632b3bd Mon Sep 17 00:00:00 2001 From: devnoname120 Date: Wed, 23 Mar 2022 21:46:15 +0100 Subject: [PATCH] Fix configuration on macOS 12.3+ --- gist.py | 6 +++--- info.plist | 8 ++++---- workflow/background.py | 2 +- workflow/workflow.py | 4 ++-- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/gist.py b/gist.py index aa47dac..9379a31 100755 --- a/gist.py +++ b/gist.py @@ -46,7 +46,7 @@ def update_status(): update_status() wf.send_feedback() if not is_running(u"update_gists"): - run_in_background(u"update_gists", ['/usr/bin/python', wf.workflowfile('update_gists.py')]) + run_in_background(u"update_gists", ['/usr/bin/env', 'python', wf.workflowfile('update_gists.py')]) sys.exit() elif is_running(u"update_gists"): update_status() @@ -72,7 +72,7 @@ def main(wf): # Update daily. if diff > 60*60*24: if not is_running(u"update_gists"): - run_in_background('update_gists',['/usr/bin/python', wf.workflowfile('update_gists.py')]) + run_in_background('update_gists',['/usr/bin/env', 'python', wf.workflowfile('update_gists.py')]) wf.add_item('Gist update triggered', icon="icons/download.png") initial_load() @@ -105,7 +105,7 @@ def main(wf): wf.add_item(u"Update (last update: {})".format(last_update_msg), autocomplete="Update", icon="icons/download.png") elif term == "Update": if not is_running(u"update_gists"): - run_in_background('update_gists',['/usr/bin/python', wf.workflowfile('update_gists.py')]) + run_in_background('update_gists',['/usr/bin/env', 'python', wf.workflowfile('update_gists.py')]) wf.add_item('Updating gists...', subtitle=u"Update runs in the backround.", valid=True, icon="icons/download.png") wf.send_feedback() sys.exit() diff --git a/info.plist b/info.plist index 6bfe2a0..4281f2f 100644 --- a/info.plist +++ b/info.plist @@ -506,7 +506,7 @@ escaping 116 script - python set_info.py "{query}" + /usr/bin/env python set_info.py "{query}" scriptargtype 1 scriptfile @@ -695,7 +695,7 @@ runningsubtext script - python gist.py "{query}" + /usr/bin/env python gist.py "{query}" scriptargtype 1 scriptfile @@ -902,7 +902,7 @@ escaping 116 script - python set_info.py "{query}" + /usr/bin/env python set_info.py "{query}" scriptargtype 1 scriptfile @@ -964,7 +964,7 @@ runningsubtext script - python gist_set.py "{query}" + /usr/bin/env python gist_set.py "{query}" scriptargtype 1 scriptfile diff --git a/workflow/background.py b/workflow/background.py index ba5c52a..6cb4ca5 100644 --- a/workflow/background.py +++ b/workflow/background.py @@ -233,7 +233,7 @@ def run_in_background(name, args, **kwargs): _log().debug('[%s] command cached: %s', name, argcache) # Call this script - cmd = ['/usr/bin/python', __file__, name] + cmd = ['/usr/bin/env', 'python', __file__, name] _log().debug('[%s] passing job to background runner: %r', name, cmd) retcode = subprocess.call(cmd) diff --git a/workflow/workflow.py b/workflow/workflow.py index 2a057b0..2fe40ab 100644 --- a/workflow/workflow.py +++ b/workflow/workflow.py @@ -2330,7 +2330,7 @@ def check_update(self, force=False): update_script = os.path.join(os.path.dirname(__file__), b'update.py') - cmd = ['/usr/bin/python', update_script, 'check', repo, version] + cmd = ['/usr/bin/env', 'python', update_script, 'check', repo, version] if self.prereleases: cmd.append('--prereleases') @@ -2369,7 +2369,7 @@ def start_update(self): update_script = os.path.join(os.path.dirname(__file__), b'update.py') - cmd = ['/usr/bin/python', update_script, 'install', repo, version] + cmd = ['/usr/bin/env', 'python', update_script, 'install', repo, version] if self.prereleases: cmd.append('--prereleases')