Skip to content

Commit

Permalink
Merge pull request #10 from artemy/feature/#9-fix-app-names
Browse files Browse the repository at this point in the history
#9: Open apps via bundle identifiers to avoid renaming issues
  • Loading branch information
artemy authored Aug 14, 2023
2 parents 08c064c + 0dc98c2 commit 5a7703b
Show file tree
Hide file tree
Showing 5 changed files with 46 additions and 36 deletions.
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()

0 comments on commit 5a7703b

Please sign in to comment.