upgradeFromGit : fix bug and improve some thing
authorBenjamin Renard <brenard@aconit.easter-eggs.fr>
Fri, 13 Nov 2009 16:21:30 +0000 (17:21 +0100)
committerBenjamin Renard <brenard@aconit.easter-eggs.fr>
Fri, 13 Nov 2009 16:21:30 +0000 (17:21 +0100)
config.local/.gitignore
config.local/local.sh.example
upgradeFromGit.sh

index 4021b54..2f63430 100644 (file)
@@ -1,6 +1,5 @@
 *.php
-*.php~
 *.tpl
-*.tpl~
 *.orig
 *.sh
+*~
index 4ea8ad4..73436aa 100644 (file)
@@ -4,7 +4,6 @@
 LOCAL_FILES="
 "
 
-LOCAL_SAV_DIR="$ROOT_DIR/config.local"
 LOG_FILE="$ROOT_DIR/upgrade.log"
 
 # The theme name to install (optional)
index 0fd41e2..f9b62a0 100755 (executable)
@@ -2,15 +2,16 @@
 
 
 ROOT_DIR=$( cd `dirname $0`; pwd )
+LOCAL_SAV_DIR="$ROOT_DIR/config.local"
 
 # Import config
-if [ ! -f $ROOT_DIR/config.local/local.sh ]
+if [ ! -f $LOCAL_SAV_DIR/local.sh ]
 then
     echo "Error : You don't have create your own local.sh file in config.local directory. You could rely on the local.sh.example file to create your version."
     exit 1
 fi
 
-source $ROOT_DIR/config.local/local.sh
+source $LOCAL_SAV_DIR/local.sh
 
 function msg() {
     echo $2 "$1" | tee -a "$LOG_FILE"
@@ -119,10 +120,9 @@ do
                        if [ -f $SRC.orig ]
                        then
                                DIFF=`diff $ROOT_DIR/$i.sav $SRC.orig`
-                               msg "$DIFF" -e
                                if [ "$DIFF" != "" ]
                                then    
-                                       msg "\n\t\t\t-> Caution : This file changed. Do you want edit this file now ? [y/N] " -en
+                                   msg "\n$DIFF\n\t\t\t-> Caution : This file changed. Do you want edit this file now ? [y/N] " -en
                                        read a
                                        echo "Reponse : $a"  >> $LOG_FILE
                                        if [ "$a" == "y" -o "$a" == "Y" ]
@@ -133,7 +133,7 @@ do
                                        msg "No change"
                                fi
                        else
-                               echo
+                               msg "Original backup file does not exist. Pass ..."
                        fi
                        msg "\t\t-> Backup file for next upgrade : " -en
                        cp -f $ROOT_DIR/$i.sav $SRC.orig >> $LOG_FILE 2>&1