Skip to content

Instantly share code, notes, and snippets.

@notabene00
Forked from mathiasbynens/appify
Last active August 29, 2015 14:17
Show Gist options
  • Save notabene00/d286c261e05f683aca30 to your computer and use it in GitHub Desktop.
Save notabene00/d286c261e05f683aca30 to your computer and use it in GitHub Desktop.
#!/bin/bash
if [ -z "$1" ]; then exit; fi
nameOfScript=`withoutPath=${1##*/};withoutExtension=${withoutPath%.*};echo $withoutExtension` #cuz it can be '*.sh', '*.py', '*.pl', '*.rb' and other files
folderOfScript="$nameOfScript.app/Contents/MacOS"
mkdir -p "$folderOfScript"
cp "$1" "$folderOfScript/$nameOfScript"
chmod +x "$folderOfScript/$nameOfScript"
echo "Seems like success."
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment