Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change python paths to python2 for MacOS Monterey compatibility #35

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -133,3 +133,4 @@ ENV/

# Rope project settings
.ropeproject
.DS_Store
2 changes: 2 additions & 0 deletions src/README.html
Original file line number Diff line number Diff line change
Expand Up @@ -674,6 +674,8 @@ <h2>Download</h2>

<p>For Alfred 3, download <a href="https://github.com/deanishe/alfred-repos/releases/tag/v2.1.2">version 2.1.2</a>, and for Alfred 2, please download <a href="https://github.com/deanishe/alfred-repos/releases/tag/v1.7">version 1.7</a>.</p>

<p><strong>Due to Apple removing Python 2 from MacOS Monterey you need to manually install <a href="https://www.python.org/downloads/release/python-2716/">Python 2</a> for this workflow to work.</strong></p>

<h2>Usage</h2>

<p>This workflow requires some configuration before use. See <a href="#configuration">Configuration</a> for details.</p>
Expand Down
8 changes: 4 additions & 4 deletions src/info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@
<key>runningsubtext</key>
<string>Loading list of repos…</string>
<key>script</key>
<string>/usr/bin/python repos.py search "$1"</string>
<string>/usr/local/bin/python2 repos.py search "$1"</string>
<key>scriptargtype</key>
<integer>1</integer>
<key>scriptfile</key>
Expand Down Expand Up @@ -173,7 +173,7 @@
<key>escaping</key>
<integer>102</integer>
<key>script</key>
<string>/usr/bin/python repos.py open $appkey "$1"</string>
<string>/usr/local/bin/python2 repos.py open $appkey "$1"</string>
<key>scriptargtype</key>
<integer>1</integer>
<key>scriptfile</key>
Expand Down Expand Up @@ -215,7 +215,7 @@ variables={allvars}</string>
<key>escaping</key>
<integer>127</integer>
<key>script</key>
<string>/usr/bin/python repos.py settings</string>
<string>/usr/local/bin/python2 repos.py settings</string>
<key>scriptargtype</key>
<integer>1</integer>
<key>scriptfile</key>
Expand Down Expand Up @@ -324,7 +324,7 @@ variables={allvars}</string>
<key>escaping</key>
<integer>127</integer>
<key>script</key>
<string>/usr/bin/python repos.py update</string>
<string>/usr/local/bin/python2 repos.py update</string>
<key>scriptargtype</key>
<integer>1</integer>
<key>scriptfile</key>
Expand Down
4 changes: 2 additions & 2 deletions src/repos.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env /usr/local/bin/python2
# encoding: utf-8
#
# Copyright (c) 2013 deanishe@deanishe.net.
Expand Down Expand Up @@ -280,7 +280,7 @@ def do_update():
int: Exit status.

"""
run_in_background('update', ['/usr/bin/python', 'update.py'])
run_in_background('update', ['/usr/local/bin/python2', 'update.py'])
return 0


Expand Down
2 changes: 1 addition & 1 deletion src/workflow/background.py
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,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/local/bin/python2', __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 src/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/local/bin/python2', 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/local/bin/python2', update_script, 'install', repo, version]

if self.prereleases:
cmd.append('--prereleases')
Expand Down