mirror of
https://gitlab.easter-eggs.com/ee/ldapsaisie.git
synced 2024-11-22 18:09:06 +01:00
upgradeFromGit.sh : add gettext MO file change detection
This commit is contained in:
parent
63cd2e6fbc
commit
ab72dbb8a3
2 changed files with 26 additions and 0 deletions
|
@ -14,6 +14,9 @@ THEME_TPL_REF="default"
|
||||||
THEME_CSS_REF="default"
|
THEME_CSS_REF="default"
|
||||||
THEME_IMG_REF="default"
|
THEME_IMG_REF="default"
|
||||||
|
|
||||||
|
# Webserver service reload command to run on gettext MO files changed
|
||||||
|
#WEBSERVER_RELOAD_CMD='sudo service apache2 force-reload'
|
||||||
|
|
||||||
# Do doc export ?
|
# Do doc export ?
|
||||||
BUILD_DOC=1
|
BUILD_DOC=1
|
||||||
|
|
||||||
|
|
|
@ -29,6 +29,10 @@ function check_file_or_symlink() {
|
||||||
|
|
||||||
cd $ROOT_DIR
|
cd $ROOT_DIR
|
||||||
|
|
||||||
|
msg "-> Store gettext MO files state : "
|
||||||
|
MO_STATE_BEFORE=$( find $ROOT_DIR/public_html/lang/ -type f -name '*.mo'|sort -u|xargs md5sum )
|
||||||
|
msg "done."
|
||||||
|
|
||||||
msg "-> Clean git repos : "
|
msg "-> Clean git repos : "
|
||||||
for i in $LOCAL_FILES
|
for i in $LOCAL_FILES
|
||||||
do
|
do
|
||||||
|
@ -242,6 +246,25 @@ then
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
msg "-> Check for gettext MO files changes : "
|
||||||
|
MO_STATE_AFTER=$( find $ROOT_DIR/public_html/lang/ -type f -name '*.mo'|sort -u|xargs md5sum )
|
||||||
|
if [ "$MO_STATE_AFTER" == "$MO_STATE_BEFORE" ]
|
||||||
|
then
|
||||||
|
msg "No change detected."
|
||||||
|
elif [ -n "$WEBSERVER_RELOAD_CMD" ]
|
||||||
|
then
|
||||||
|
msg "Changed detected : try to webserver to handle changes..."
|
||||||
|
$WEBSERVER_RELOAD_CMD
|
||||||
|
if [ $? -eq 0 ]
|
||||||
|
then
|
||||||
|
msg "done."
|
||||||
|
else
|
||||||
|
msg "ERROR"
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
msg "Changed detected :\n\n/!\\ You have to force-reload your webserver to handle it ! /!\\\n\n"
|
||||||
|
fi
|
||||||
|
|
||||||
if [ $BUILD_DOC -eq 1 ]
|
if [ $BUILD_DOC -eq 1 ]
|
||||||
then
|
then
|
||||||
[ -n "$LAST_UPDATE_FILE" ] && [ "`$ROOT_DIR/checkDocExportsNecessity.sh`" == "" ] && echo "Export documentation is not necessary. Pass." && exit
|
[ -n "$LAST_UPDATE_FILE" ] && [ "`$ROOT_DIR/checkDocExportsNecessity.sh`" == "" ] && echo "Export documentation is not necessary. Pass." && exit
|
||||||
|
|
Loading…
Reference in a new issue