Upgrade shtpl installer

This commit is contained in:
dig 2019-03-02 22:22:04 +01:00
parent 00c9868ebd
commit 9d10846ff9
1 changed files with 21 additions and 3 deletions

View File

@ -1,6 +1,24 @@
#!/usr/bin/env bash
from=$(pwd)/$(dirname "$0")
to=/usr/local/bin
install()
{
name="shtpl"
from="$(pwd)/$(dirname "$0")"
to="/usr/local/bin"
[[ -n "$yes" ]] && v=y || read -re -p "Voulez-vous installer $name ? (y/n)" v
if [ $v = y ]
then
echo "Installation de $name en cours ..."
if [ -f /usr/local/bin/$name ]; then
rm /usr/local/bin/$name
fi
cp $from/shtpl $to/shtpl
echo "Installation terminé !"
fi
}
install
cp $from/shtpl $to/shtpl