-
-
Save ivan-leschinsky/d83c565fcb2d083a5cb89cbf503e80c5 to your computer and use it in GitHub Desktop.
appify — create the simplest possible Mac app from a shell script (adds an application icon)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env bash | |
| # | |
| # url : https://gist.github.com/672684 | |
| # version : 2.0 | |
| # name : appify | |
| # description : Create the simplest possible mac app from a shell script. | |
| # usage : cat my-script.sh | appify MyApp | |
| # platform : Mac OS X | |
| # author : Thomas Aylott <[email protected]> | |
| APPNAME=${1:-Untitled} | |
| if [[ -a "$APPNAME.app" ]]; then | |
| echo "App already exists" >&2 | |
| echo "$PWD/$APPNAME.app" | |
| exit 1 | |
| fi | |
| mkdir -p "$APPNAME.app/Contents/MacOS" | |
| touch "$APPNAME.app/Contents/MacOS/$APPNAME" | |
| chmod +x "$APPNAME.app/Contents/MacOS/$APPNAME" | |
| while read SCRIPT_SOURCE_LINE; do | |
| echo "$SCRIPT_SOURCE_LINE" >> "$APPNAME.app/Contents/MacOS/$APPNAME" | |
| done | |
| echo "$PWD/$APPNAME.app" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment