upgradeFromGit : Move configuration variables in a local.sh file.
authorBenjamin Renard <brenard@aconit.easter-eggs.fr>
Fri, 13 Nov 2009 16:04:59 +0000 (17:04 +0100)
committerBenjamin Renard <brenard@aconit.easter-eggs.fr>
Fri, 13 Nov 2009 16:04:59 +0000 (17:04 +0100)
config.local/.gitignore
config.local/local.sh.example [new file with mode: 0644]
upgradeFromGit.sh

index 518aa97..4021b54 100644 (file)
@@ -3,3 +3,4 @@
 *.tpl
 *.tpl~
 *.orig
+*.sh
diff --git a/config.local/local.sh.example b/config.local/local.sh.example
new file mode 100644 (file)
index 0000000..4ea8ad4
--- /dev/null
@@ -0,0 +1,15 @@
+#!/bin/sh
+
+# List of local files which will be install in web root
+LOCAL_FILES="
+"
+
+LOCAL_SAV_DIR="$ROOT_DIR/config.local"
+LOG_FILE="$ROOT_DIR/upgrade.log"
+
+# The theme name to install (optional)
+#THEME="mytheme"
+
+# Do doc export ?
+DO_DOC=1
+
index 3a6a046..0fd41e2 100755 (executable)
@@ -1,19 +1,16 @@
 #!/bin/sh
 
-ROOT_DIR=$( cd `dirname $0`; pwd )
-
-# List of local files which will be install in web root
-LOCAL_FILES="
-"
 
-LOCAL_SAV_DIR="$ROOT_DIR/config.local"
-LOG_FILE="$ROOT_DIR/upgrade.log"
+ROOT_DIR=$( cd `dirname $0`; pwd )
 
-# The theme name to install (optional)
-#THEME="inha"
+# Import config
+if [ ! -f $ROOT_DIR/config.local/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
 
-# Do doc export ?
-DO_DOC=1
+source $ROOT_DIR/config.local/local.sh
 
 function msg() {
     echo $2 "$1" | tee -a "$LOG_FILE"