Last active
July 29, 2017 08:29
-
-
Save jonathanvdc/f2fa3b5f8d5ece27b877fae439d944d0 to your computer and use it in GitHub Desktop.
A script that generates a wrapper script to run mono on an executable.
This file contains 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
#!/usr/bin/env bash | |
if [ $# -lt 2 ]; then | |
echo "Usage: mono-ln filename.exe script-path.sh [readlink|greadlink]" | |
fi | |
if [ $# -lt 3 ]; then | |
readlink_name="readlink" | |
else | |
readlink_name=$3 | |
fi | |
# Build a bash script that runs $1 at $2 | |
echo "#!/usr/bin/env bash" > $2 | |
echo >> $2 | |
echo "# This script explicitly calls 'mono' to run '$1'" >> $2 | |
echo "mono \"\$(dirname \"\$($readlink_name -f \"\$0\")\")/$1\" \$@" >> $2 | |
chmod +x $2 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment