Skip to content

Instantly share code, notes, and snippets.

Created October 12, 2017 05:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save anonymous/e9c5c9cbc1a501a013ef2bb3c64d0a6b to your computer and use it in GitHub Desktop.
Save anonymous/e9c5c9cbc1a501a013ef2bb3c64d0a6b to your computer and use it in GitHub Desktop.
#!/usr/bin/env bash
# appify your-shell-script.sh "Your App Name"
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