FG42/install.sh

85 lines
1.9 KiB
Bash
Raw Normal View History

2011-07-22 14:48:30 +01:00
#! /bin/bash
VERSION=1.0.0
remoteconffile=
remoteexecutable=
conffile=conf/dotkuso
2011-12-03 10:34:57 +00:00
# Gathering informations
echo -e "\n\033[01;32mKuso IDE\033[00m $VERSION copyright 2010-2013 \033[01;34mSameer Rahmani <lxsameer@gnu.org>\033[00m\n\n"
2011-12-03 10:34:57 +00:00
echo "Enter requested informations. You can change it later in top"
echo -e "your init file.\n\n"
2011-12-05 11:06:21 +00:00
condition="1"
while [ "$condition" == "1" ] ; do
read -p "Do you want to install Kuso IDE as an stand alone application ([y]/n)? " standalone
if [ "$standalone" == "" -o "$standalone" == "y" ]
then
standalone="y"
dotemacs=~/.kuso_dev
repo=~/.kuso.d_dev
2011-12-05 11:06:21 +00:00
condition="0"
executable=kuso-dev
2011-12-05 11:06:21 +00:00
fi
if [ "$standalone" == "n" ]
then
dotemacs=~/.emacs
repo=~/.emacs.d
condition="0"
executable=emacs-dev
2011-12-05 11:06:21 +00:00
fi
done
2011-12-03 10:34:57 +00:00
read -p "Enter your full name: " fullname
read -p "Enter your email address: " mail
read -p "Where is your workspace directory[~/src/]: " workspace
# Validating informations
if [ "$workspace" == "" ]
then
2011-12-03 11:18:19 +00:00
workspace="$HOME/src/"
2011-12-03 10:34:57 +00:00
fi
2011-12-05 11:06:21 +00:00
addr=$HOME/.kuso.d
2011-07-29 12:37:34 +01:00
2011-12-03 10:34:57 +00:00
# Installing stage1
kusohome=`pwd`
2011-12-05 11:06:21 +00:00
mkdir -p $repo
if [ -e $dotemacs ]; then
echo "Backing up exists init file . . ."
#cp $dotemacs "$dotemacs.backup"
2011-07-22 14:48:30 +01:00
fi
2011-12-03 10:34:57 +00:00
echo "Copying files . . . "
if [ -e $conffile ]
then
cp $conffile $dotemacs
cp bin/$executable $repo/$executable
else
wget $remoteconffile -o $dotemacs
wget $remoteexecutable -o $repo/$executable
fi
2011-12-05 13:59:14 +00:00
if [ "$standalone" == "" -o "$standalone" == "y" ]
2011-12-05 13:59:14 +00:00
then
sudo ln -s $repo/$executable /usr/bin/$executable
2011-12-05 13:59:14 +00:00
fi
2011-12-03 10:34:57 +00:00
sed "s/--EMAIL--/$mail/mg" -i $dotemacs
sed "s/--FULLNAME--/$fullname/mg" -i $dotemacs
sed "s,--WORKSPACE--,$workspace,mg" -i $dotemacs
sed "s,--REPO--,$repo,mg" -i $dotemacs
2011-12-03 10:34:57 +00:00
2011-12-05 15:11:36 +00:00
echo "Copy the below code in your initial shell script:"
echo
2011-12-05 15:11:36 +00:00
echo "export PATH=\$PATH:$repo"
2011-12-03 11:18:19 +00:00
echo -e "\nInstallation finished."
2011-12-05 19:45:26 +00:00
echo "Restart the GNU/Emacs and make sure that all the requirements met."
echo
2011-12-05 19:53:46 +00:00
printf "\033[01;33mImportant Note:\033[00m Do NOT remove the Kuso IDE source.\n"