2018-02-17 20:25:18 -07:00
|
|
|
#!/bin/bash
|
|
|
|
|
2018-03-08 03:52:57 -07:00
|
|
|
linkDir="/usr/local/bin"
|
2018-02-17 20:25:18 -07:00
|
|
|
|
|
|
|
|
|
|
|
function juliaLang(){
|
|
|
|
name="julia"
|
|
|
|
version="0.6.2"
|
2018-03-08 03:52:57 -07:00
|
|
|
linkDir="${linkDir}"
|
2018-02-17 20:25:18 -07:00
|
|
|
|
|
|
|
if [ ! -f "${linkDir}/${name}" ];then
|
|
|
|
printf "\nLinking $(pwd)/${name}-${version}/bin/${name} to ${linkDir}\n"
|
|
|
|
ln -s $(pwd)/${name}-${version}/bin/${name} ${linkDir}/${name}
|
|
|
|
else
|
2018-03-08 03:52:57 -07:00
|
|
|
printf "\n${name} exists in ${linkDir}\n"
|
2018-02-17 20:25:18 -07:00
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
|
|
|
function idd(){
|
|
|
|
name="idd"
|
2018-03-08 03:52:57 -07:00
|
|
|
linkDir="${linkDir}"
|
2018-02-17 20:25:18 -07:00
|
|
|
|
|
|
|
if [ ! -f "${linkDir}/${name}" ];then
|
|
|
|
printf "\nLinking ${pwd}/${name} to ${linkDir}\n"
|
2018-03-08 03:52:57 -07:00
|
|
|
ln -s $(pwd)/${name}.sh ${linkDir}/${name}
|
2018-02-17 20:25:18 -07:00
|
|
|
else
|
2018-03-08 03:52:57 -07:00
|
|
|
printf "${name} already exists in ${linkDir}\n"
|
2018-02-17 20:25:18 -07:00
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2018-03-08 03:52:57 -07:00
|
|
|
function svc(){
|
|
|
|
name="svc"
|
|
|
|
linkDir="${linkDir}"
|
|
|
|
|
|
|
|
if [ ! -f "${linkDir}/${name}" ];then
|
|
|
|
printf "\nLinking ${pwd}/${name} to ${linkDir}\n"
|
|
|
|
ln -s $(pwd)/${name}.sh ${linkDir}/${name}
|
|
|
|
else
|
|
|
|
printf "${name} already exists in ${linkDir}\n"
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
2018-02-17 20:25:18 -07:00
|
|
|
case "${1}" in
|
|
|
|
|
2018-03-08 03:52:57 -07:00
|
|
|
-r | --remove )
|
|
|
|
rm -v ${linkDir}/${2};;
|
2018-02-17 20:25:18 -07:00
|
|
|
julia )
|
2018-03-08 03:52:57 -07:00
|
|
|
juliaLang;;
|
2018-02-17 20:25:18 -07:00
|
|
|
|
|
|
|
idd )
|
2018-03-08 03:52:57 -07:00
|
|
|
idd;;
|
|
|
|
|
|
|
|
svc )
|
|
|
|
svc;;
|
2018-02-17 20:25:18 -07:00
|
|
|
|
2018-03-08 03:52:57 -07:00
|
|
|
test )
|
|
|
|
echo ${linkDir};;
|
2018-02-17 20:25:18 -07:00
|
|
|
* ) printf "\n${0} <command>\n"
|
|
|
|
;;
|
|
|
|
|
|
|
|
esac
|