add checks and confirm, to installer.
This commit is contained in:
57
install.sh
57
install.sh
@@ -1,5 +1,5 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
INSTALLPATH="/usr/local/bin"
|
||||||
|
|
||||||
which ()
|
which ()
|
||||||
{
|
{
|
||||||
@@ -18,9 +18,54 @@ if [ $? != 0 ];then
|
|||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
sudo cp -v src/jprog.jl /usr/local/bin/jprog
|
|
||||||
if [ ! -f /usr/local/bin/jprog ];then
|
|
||||||
echo -e "/nUnable to install, please check permissions...\n"
|
function checkInstall() {
|
||||||
|
|
||||||
|
if [ -f ${INSTALLPATH}/jprog ];then
|
||||||
|
echo -e "\nJprog is successfully installed!\n"
|
||||||
|
|
||||||
else
|
else
|
||||||
echo -e "Jprog is successfully installed!\n"
|
echo -e "\nCould not install, check permissions!\n"
|
||||||
fi
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
function installProcess() {
|
||||||
|
if [ ! -f ${INSTALLPATH}/jprog ];then
|
||||||
|
echo -e -n "\nDo you want to install jprog to ${INSTALLPATH}?(Y/n): "
|
||||||
|
read doinstall
|
||||||
|
|
||||||
|
if [ "${doinstall}" = "y" ];then
|
||||||
|
echo -e "\nInstalling jprog to ${INSTALLPATH}...\n"
|
||||||
|
sudo cp -v src/jprog.jl ${INSTALLPATH}/jprog
|
||||||
|
|
||||||
|
checkInstall
|
||||||
|
|
||||||
|
elif [ "${doinstall}" = "n" ];then
|
||||||
|
exit 0;
|
||||||
|
|
||||||
|
else
|
||||||
|
echo -e "\nPlease enter y or n ...\n"
|
||||||
|
fi
|
||||||
|
|
||||||
|
elif [ -f ${INSTALLPATH}/jprog ];then
|
||||||
|
echo -e -n "Jprog is already installed, reinstall?(Y/n): "
|
||||||
|
read reinstall
|
||||||
|
|
||||||
|
if [ "${reinstall}" = "y" ];then
|
||||||
|
echo -e "\nRe-installing jprog to ${INSTALLPATH}...\n"
|
||||||
|
sudo cp -v src/jprog.jl ${INSTALLPATH}/jprog
|
||||||
|
checkInstall
|
||||||
|
|
||||||
|
elif [ "${reinstall}" = "n" ];then
|
||||||
|
exit 0;
|
||||||
|
|
||||||
|
else
|
||||||
|
echo -e "Please enter y or n ...\n"
|
||||||
|
fi
|
||||||
|
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
installProcess
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user