From 65e0be5a18a00c8852b214271534b131d6f740bf Mon Sep 17 00:00:00 2001 From: intuxicated Date: Thu, 18 Jul 2013 16:48:08 +0430 Subject: [PATCH 1/4] add requirments check functionality --- install.sh | 30 +++++++++++++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-) diff --git a/install.sh b/install.sh index eb9aa95..748997c 100755 --- a/install.sh +++ b/install.sh @@ -12,9 +12,11 @@ remoteexecutable="http://raw.github.com/Karajlug/KusoIDE/1.0/bin/kuso" conffile=conf/dotkuso +REQUIRMENTS=(emacs git) + # Coloring Functions function info() { - echo -e "[\033[01;32mINFO\033[00m]: $1" + echo -ne "[\033[01;32mINFO\033[00m]: $1" } function error(){ @@ -25,8 +27,34 @@ function warn(){ echo -e "[\033[01;33mWARN\033[00m]: $1" } +function requirments_check(){ + for app in "${REQUIRMENTS[@]}" + do + echo -ne "[\033[01;32mINFO\033[00m]: $app \033[01;34m[CHEKING]\033[00m \r" + if hash $1 2>/dev/null; then + echo -ne "[\033[01;32mINFO\033[00m]: $app \033[01;34m[OK]\033[00m \n" + else + REQUIRMENT_CHECK=false + echo -ne "[\033[01;32mINFO\033[00m]: $app \033[01;31m[ERR]\033[00m \n" + fi + done +} + # Gathering informations echo -e "\n\033[01;32mKuso IDE\033[00m $VERSION copyright 2010-2013 \033[01;34mSameer Rahmani \033[00m\n\n" + +# Requirments check to make sure everything is ok +echo -e "Requirment Check" +# if this variable changed to fasle , means we have something to install +REQUIRMENT_CHECK=true +requirments_check $REQUIRMENTS +# exit if our requirement check +if [ $REQUIRMENT_CHECK == false ]; then + error "Please install requirments first"; + exit; +fi +echo -e "\n\n" + echo "Enter requested informations. You can change it later in top" echo -e "your init file.\n\n" From 1f93ce96a4b0e85782568e1185e6fcd5e0d45d92 Mon Sep 17 00:00:00 2001 From: intuxicated Date: Thu, 18 Jul 2013 16:50:55 +0430 Subject: [PATCH 2/4] remove typo --- install.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install.sh b/install.sh index 748997c..a9ec4f2 100755 --- a/install.sh +++ b/install.sh @@ -16,7 +16,7 @@ REQUIRMENTS=(emacs git) # Coloring Functions function info() { - echo -ne "[\033[01;32mINFO\033[00m]: $1" + echo -e "[\033[01;32mINFO\033[00m]: $1" } function error(){ From 671fa60743e86c61fc8d66927a7a55d74966aebc Mon Sep 17 00:00:00 2001 From: intuxicated Date: Thu, 18 Jul 2013 16:58:00 +0430 Subject: [PATCH 3/4] replace tabs with space --- install.sh | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/install.sh b/install.sh index a9ec4f2..6a01dfa 100755 --- a/install.sh +++ b/install.sh @@ -30,13 +30,13 @@ function warn(){ function requirments_check(){ for app in "${REQUIRMENTS[@]}" do - echo -ne "[\033[01;32mINFO\033[00m]: $app \033[01;34m[CHEKING]\033[00m \r" - if hash $1 2>/dev/null; then - echo -ne "[\033[01;32mINFO\033[00m]: $app \033[01;34m[OK]\033[00m \n" - else - REQUIRMENT_CHECK=false - echo -ne "[\033[01;32mINFO\033[00m]: $app \033[01;31m[ERR]\033[00m \n" - fi + echo -ne "[\033[01;32mINFO\033[00m]: $app \033[01;34m[CHEKING]\033[00m \r" + if hash $1 2>/dev/null; then + echo -ne "[\033[01;32mINFO\033[00m]: $app \033[01;34m[OK]\033[00m \n" + else + REQUIRMENT_CHECK=false + echo -ne "[\033[01;32mINFO\033[00m]: $app \033[01;31m[ERR]\033[00m \n" + fi done } @@ -64,20 +64,20 @@ while [ "$condition" == "1" ] ; do if [ "$standalone" == "" -o "$standalone" == "y" ] then - standalone="y" - dotemacs=~/.kuso_dev - repo=~/.kuso.d_dev - condition="0" - executable=kuso-dev + standalone="y" + dotemacs=~/.kuso_dev + repo=~/.kuso.d_dev + condition="0" + executable=kuso-dev fi if [ "$standalone" == "n" ] then - dotemacs=~/.emacs - repo=~/.emacs.d - condition="0" + dotemacs=~/.emacs + repo=~/.emacs.d + condition="0" - executable=emacs-dev + executable=emacs-dev fi done From 484b9ba7657dde970d23209e54e04689f64e4eb3 Mon Sep 17 00:00:00 2001 From: intuxicated Date: Thu, 18 Jul 2013 17:02:30 +0430 Subject: [PATCH 4/4] fix typo --- install.sh | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/install.sh b/install.sh index 6a01dfa..fb009c2 100755 --- a/install.sh +++ b/install.sh @@ -12,7 +12,7 @@ remoteexecutable="http://raw.github.com/Karajlug/KusoIDE/1.0/bin/kuso" conffile=conf/dotkuso -REQUIRMENTS=(emacs git) +REQUIREMENTS=(emacs git) # Coloring Functions function info() { @@ -27,14 +27,14 @@ function warn(){ echo -e "[\033[01;33mWARN\033[00m]: $1" } -function requirments_check(){ +function requirements_check(){ for app in "${REQUIRMENTS[@]}" do echo -ne "[\033[01;32mINFO\033[00m]: $app \033[01;34m[CHEKING]\033[00m \r" if hash $1 2>/dev/null; then echo -ne "[\033[01;32mINFO\033[00m]: $app \033[01;34m[OK]\033[00m \n" else - REQUIRMENT_CHECK=false + REQUIREMENTS_CHECK=false echo -ne "[\033[01;32mINFO\033[00m]: $app \033[01;31m[ERR]\033[00m \n" fi done @@ -46,10 +46,10 @@ echo -e "\n\033[01;32mKuso IDE\033[00m $VERSION copyright 2010-2013 \033[01;34mS # Requirments check to make sure everything is ok echo -e "Requirment Check" # if this variable changed to fasle , means we have something to install -REQUIRMENT_CHECK=true -requirments_check $REQUIRMENTS +REQUIREMENTS_CHECK=true +requirements_check $REQUIREMENTS # exit if our requirement check -if [ $REQUIRMENT_CHECK == false ]; then +if [ $REQUIREMENTS_CHECK == false ]; then error "Please install requirments first"; exit; fi