Merge branch 'master' of https://gitbutter.pw/mollusk/jitty-scripts
Former-commit-id: cde35229cdc4f6f4f651686a511ffca81b3152d8
This commit is contained in:
commit
7ccb1fc0d8
36
symlinker.sh
36
symlinker.sh
@ -1,45 +1,63 @@
|
||||
#!/bin/bash
|
||||
|
||||
linkDir="/usr/local/bin"
|
||||
|
||||
|
||||
function juliaLang(){
|
||||
name="julia"
|
||||
version="0.6.2"
|
||||
linkDir="/usr/bin"
|
||||
linkDir="${linkDir}"
|
||||
|
||||
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
|
||||
printf "\n${name} exists in $(which julia)\n"
|
||||
printf "\n${name} exists in ${linkDir}\n"
|
||||
fi
|
||||
}
|
||||
|
||||
function idd(){
|
||||
name="idd"
|
||||
linkDir="/usr/bin"
|
||||
linkDir="${linkDir}"
|
||||
|
||||
if [ ! -f "${linkDir}/${name}" ];then
|
||||
printf "\nLinking ${pwd}/${name} to ${linkDir}\n"
|
||||
ln -s ${pwd}/idd.sh ${linkDir}/${name}
|
||||
ln -s $(pwd)/${name}.sh ${linkDir}/${name}
|
||||
else
|
||||
printf "${name} already exists in $(which idd)\n"
|
||||
printf "${name} already exists in ${linkDir}\n"
|
||||
fi
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
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
|
||||
}
|
||||
|
||||
case "${1}" in
|
||||
|
||||
-r | --remove )
|
||||
rm -v ${linkDir}/${2};;
|
||||
julia )
|
||||
juliaLang
|
||||
;;
|
||||
juliaLang;;
|
||||
|
||||
idd )
|
||||
idd
|
||||
;;
|
||||
idd;;
|
||||
|
||||
svc )
|
||||
svc;;
|
||||
|
||||
test )
|
||||
echo ${linkDir};;
|
||||
* ) printf "\n${0} <command>\n"
|
||||
;;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user