Skip to content

Instantly share code, notes, and snippets.

@bramblex
Forked from anonymous/appify.sh
Last active October 12, 2017 05:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bramblex/f22c79acb404f423e59c2ce05afabe6d to your computer and use it in GitHub Desktop.
Save bramblex/f22c79acb404f423e59c2ce05afabe6d to your computer and use it in GitHub Desktop.
#!/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