upgradeFromGit/theme : added support to linking original theme files to avoid copying...
authorBenjamin Renard <brenard@rose.easter-eggs.fr>
Tue, 15 Dec 2009 17:33:22 +0000 (18:33 +0100)
committerBenjamin Renard <brenard@rose.easter-eggs.fr>
Tue, 15 Dec 2009 17:33:22 +0000 (18:33 +0100)
config.local/local.sh.example
upgradeFromGit.sh

index a08c5a6..8ebd480 100644 (file)
@@ -9,6 +9,11 @@ LOG_FILE="$ROOT_DIR/upgrade.log"
 # The theme name to install (optional)
 #THEME="mytheme"
 
+# The theme name in reference for template/CSS/image files
+THEME_TPL_REF="default"
+THEME_CSS_REF="default"
+THEME_IMG_REF="default"
+
 # Do doc export ?
 BUILD_DOC=1
 
index a3e0d6b..9355757 100755 (executable)
@@ -156,13 +156,70 @@ do
                msg "file does not exist. Pass..."
        fi
 done
+
 if [ "$THEME" != "" ]
 then
-       msg "-> Install theme : " -en
+       msg "-> Install theme : "
+
+       # TPL
+       msg "\t- Template : " -e
        ln -s $LOCAL_SAV_DIR/theme/templates $ROOT_DIR/public_html/templates/$THEME >> $LOG_FILE 2>&1
+       if [ -d $ROOT_DIR/public_html/templates/$THEME_TPL_REF ]
+       then
+               msg "\t\t-> Vérification de la présence des fichiers : " -e
+               for i in $ROOT_DIR/public_html/templates/$THEME_TPL_REF/*
+               do
+                       f=`basename $i`
+                       msg "\t\t\t- $f : " -en
+                       if [ -f $ROOT_DIR/public_html/templates/$THEME/$f ]
+                       then
+                               msg "present."
+                       else
+                               ln -s $ROOT_DIR/public_html/templates/$THEME_TPL_REF/$f $ROOT_DIR/public_html/templates/$THEME/$f
+                               msg "link."
+                       fi
+               done
+       fi
+
+       # IMG
+       msg "\t- Images : " -e
        ln -s $LOCAL_SAV_DIR/theme/images $ROOT_DIR/public_html/images/$THEME >> $LOG_FILE 2>&1
+       if [ -d $ROOT_DIR/public_html/images/$THEME_IMG_REF ]
+       then
+               msg "\t\t-> Vérification de la présence des fichiers : " -e
+               for i in $ROOT_DIR/public_html/images/$THEME_IMG_REF/*
+               do
+                       f=`basename $i`
+                       msg "\t\t\t- $f : " -en
+                       if [ -f $ROOT_DIR/public_html/images/$THEME/$f ]
+                       then
+                               msg "present."
+                       else
+                               ln -s $ROOT_DIR/public_html/images/$THEME_IMG_REF/$f $ROOT_DIR/public_html/images/$THEME/$f
+                               msg "link."
+                       fi
+               done
+       fi
+
+       # CSS
+       msg "\t- CSS : " -e
        ln -s $LOCAL_SAV_DIR/theme/css $ROOT_DIR/public_html/css/$THEME >> $LOG_FILE 2>&1
-       msg "Ok"
+       if [ -d $ROOT_DIR/public_html/css/$THEME_CSS_REF ]
+       then
+               msg "\t\t-> Vérification de la présence des fichiers : " -e
+               for i in $ROOT_DIR/public_html/css/$THEME_CSS_REF/*
+               do
+                       f=`basename $i`
+                       msg "\t\t\t- $f : " -en
+                       if [ -f $ROOT_DIR/public_html/css/$THEME/$f ]
+                       then
+                               msg "present."
+                       else
+                               ln -s $ROOT_DIR/public_html/css/$THEME_CSS_REF/$f $ROOT_DIR/public_html/css/$THEME/$f
+                               msg "link."
+                       fi
+               done
+       fi
 fi
 
 if [ $BUILD_DOC -eq 1 ]