Skip to content

Commit

Permalink
Merge pull request #19 from devnoname120/fix-config-macos-12.3
Browse files Browse the repository at this point in the history
Fix configuration on macOS 12.3+
  • Loading branch information
danielecook committed Mar 26, 2022
2 parents 3178b9f + b661d00 commit 3c1f06e
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 10 deletions.
6 changes: 3 additions & 3 deletions gist.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand All @@ -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()
Expand Down Expand Up @@ -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()
Expand Down
8 changes: 4 additions & 4 deletions info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -506,7 +506,7 @@
<key>escaping</key>
<integer>116</integer>
<key>script</key>
<string>python set_info.py "{query}"</string>
<string>/usr/bin/env python set_info.py "{query}"</string>
<key>scriptargtype</key>
<integer>1</integer>
<key>scriptfile</key>
Expand Down Expand Up @@ -695,7 +695,7 @@
<key>runningsubtext</key>
<string></string>
<key>script</key>
<string>python gist.py "{query}"</string>
<string>/usr/bin/env python gist.py "{query}"</string>
<key>scriptargtype</key>
<integer>1</integer>
<key>scriptfile</key>
Expand Down Expand Up @@ -902,7 +902,7 @@
<key>escaping</key>
<integer>116</integer>
<key>script</key>
<string>python set_info.py "{query}"</string>
<string>/usr/bin/env python set_info.py "{query}"</string>
<key>scriptargtype</key>
<integer>1</integer>
<key>scriptfile</key>
Expand Down Expand Up @@ -964,7 +964,7 @@
<key>runningsubtext</key>
<string></string>
<key>script</key>
<string>python gist_set.py "{query}"</string>
<string>/usr/bin/env python gist_set.py "{query}"</string>
<key>scriptargtype</key>
<integer>1</integer>
<key>scriptfile</key>
Expand Down
2 changes: 1 addition & 1 deletion workflow/background.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
4 changes: 2 additions & 2 deletions workflow/workflow.py
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand Down Expand Up @@ -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')
Expand Down

0 comments on commit 3c1f06e

Please sign in to comment.