-
-
Save bramblex/f22c79acb404f423e59c2ce05afabe6d to your computer and use it in GitHub Desktop.
This file contains 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 | |
# appify your-shell-script.sh "Your App Name" | |
# https://mathiasbynens.be/notes/shell-script-mac-apps | |
APPNAME=${2:-$(basename "${1}" '.sh')}; | |
DIR="${APPNAME}.app/Contents/MacOS"; | |
if [ -a "${APPNAME}.app" ]; then | |
echo "${PWD}/${APPNAME}.app already exists :("; | |
exit 1; | |
fi; | |
mkdir -p "${DIR}"; | |
cp "${1}" "${DIR}/${APPNAME}"; | |
chmod +x "${DIR}/${APPNAME}"; | |
echo "${PWD}/$APPNAME.app"; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment