This file contains hidden or 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
#!/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." |