Skip to content

Instantly share code, notes, and snippets.

@cuixin
Created September 2, 2013 13:49
Show Gist options
  • Select an option

  • Save cuixin/6413056 to your computer and use it in GitHub Desktop.

Select an option

Save cuixin/6413056 to your computer and use it in GitHub Desktop.
erlang switch version shell
#!/bin/sh
TARGET=/usr/local/bin
CURRENT=$PWD
if [ -z "$1" ] ; then
echo "no specify the erlang folder argument"
exit
fi
if [ -d "$1" ] ; then
echo "Processing "$1" -> "$TARGET
else
echo "please check your erlang folder"
exit
fi
SOURCE_DIR=$CURRENT/$1/bin
echo $SOURCE_DIR
ALL_DEL_FIELS=`ls $SOURCE_DIR`
echo "Deleting files "$ALL_DEL_FIELS
cd $TARGET
rm -rf $ALL_DEL_FIELS
echo "Linking files:"
for i in $ALL_DEL_FIELS; do
echo ln -s $SOURCE_DIR/$i $i;
ln -s $SOURCE_DIR/$i $i;
done;
echo "Processed OK"
cd $CURRENT
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment