Skip to content

Instantly share code, notes, and snippets.

View notabene00's full-sized avatar

Roman Elizarov notabene00

View GitHub Profile
#!/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."