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

#9: Open apps via bundle identifiers to avoid renaming issues #10

Merged
merged 1 commit into from
Aug 14, 2023
Merged
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
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
steps:
- uses: actions/checkout@v2
- name: Build artifacts
run: make
run: python3 build.py
- name: Create release
uses: softprops/action-gh-release@v1
with:
Expand Down
33 changes: 0 additions & 33 deletions Makefile

This file was deleted.

1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,6 @@ coverage report -m # display coverage figures
## Built With

* [Python 3.9](https://docs.python.org/3.9/)
* [GNU Make](https://www.gnu.org/software/make/manual/make.html) - Build scripting
* [coverage.py](https://coverage.readthedocs.io/) - Code coverage measurement

## Contributing
Expand Down
2 changes: 1 addition & 1 deletion alfred/info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@
<key>escaping</key>
<integer>102</integer>
<key>script</key>
<string>open -na "%APPNAME%.app" --args $@</string>
<string>open -nb "%BUNDLE%" --args $@</string>
<key>scriptargtype</key>
<integer>1</integer>
<key>scriptfile</key>
Expand Down
44 changes: 44 additions & 0 deletions build.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
import os

APPS = [
['Android Studio', 'androidstudio', 'com.google.android.studio'],
['AppCode', 'appcode', 'com.jetbrains.appcode'],
['CLion', 'clion', 'com.jetbrains.clion'],
['DataGrip', 'datagrip', 'com.jetbrains.datagrip'],
['GoLand', 'goland', 'com.jetbrains.goland'],
['IntelliJ IDEA', 'idea', 'com.jetbrains.intellij'],
['PyCharm', 'pycharm', 'com.jetbrains.pycharm'],
['WebStorm', 'webstorm', 'com.jetbrains.webstorm'],
]


def prepare_workflow(app):
app_name, keyword, bundle = app
print(f"Building {app_name}")
os.system(f'mkdir -p out/{keyword}')
os.system(f'cp icons/{keyword}.png ./out/{keyword}/icon.png')
os.system(f'cp icons/{keyword}.png ./out/{keyword}/36E4312B-0CAB-4AE7-A8B6-E30EAF07B766.png')
os.system('sed '
f'-e "s/%APPNAME%/{app_name}/g" '
f'-e "s/%KEYWORD%/{keyword}/g" '
f'-e "s/%BUNDLE%/{bundle}/g" '
f' alfred/info.plist > out/{keyword}/info.plist')
os.system(f'zip -j -r {keyword}.alfredworkflow out/{keyword}/* recent_projects.py products.json')


def build():
for app in APPS:
prepare_workflow(app)


def clean():
os.system("rm *.alfredworkflow")


def main():
clean()
build()


if __name__ == '__main__':
main()
Loading