Created
September 29, 2013 13:11
-
-
Save ypetya/6752401 to your computer and use it in GitHub Desktop.
Created this 'ln' function into my .bashrc, it emulates a 'cp' call instead of the real 'ln -s' which is not supported on windows MinGw.
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
function ln() { | |
echo "WARNING! 'ln' is an unsupported command on this platform." | |
echo " * The following command was called:" | |
echo "ln $@" | |
if [ $1 = "-s" ] ; then | |
echo " * Trying to translate it to a simple copy command : " | |
COMMAND="cp -R $2 $3" | |
echo "$COMMAND" | |
if [ -d $3 ] ; then | |
echo "Destenation directory already exists! command may fail!" | |
fi | |
echo "Continue? Y/n" | |
read "CONTINUE" | |
if [ $CONTINUE = "n" ] ; then | |
echo "Returning with code : 1" | |
return 1 | |
fi | |
$COMMAND | |
return $? | |
else | |
echo "Only -s option is supported" | |
echo "Returning with code : 1" | |
return 1 | |
fi | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment