Skip to content

Commit

Permalink
Add text logs on the demo server update script and cleanup themes bef…
Browse files Browse the repository at this point in the history
…ore installing them

This is also done to avoid CSS build issues from the previously set-up themes

Signed-off-by: William Desportes <williamdes@wdes.fr>
  • Loading branch information
williamdes committed Apr 23, 2021
1 parent ea86712 commit 249f5c1
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions demo/bin/pma-demo-update
Expand Up @@ -19,6 +19,7 @@ THEMES=`awk '/^themes/ {print $3}' ~/scripts/demo/php/versions.ini`
for REPONAME in $REPOS ; do
DIRNAME=$BASEDIR/$REPONAME
mkdir -p $DIRNAME
echo "Working on repository: $REPONAME"

if [ ! -d $DIRNAME/.git ] ; then
cd $BASEDIR
Expand Down Expand Up @@ -53,6 +54,7 @@ for REPONAME in $REPOS ; do

# Check if there has been an update
if [ $orig_head = $new_head -a "x$1" != "x--force" ] ; then
echo "Skipping repository: $REPONAME, no update found"
continue
fi
fi
Expand Down Expand Up @@ -85,6 +87,9 @@ for REPONAME in $REPOS ; do
composer update --quiet --no-dev
fi

# Cleanup all themes
find ./themes/ -maxdepth 1 -type l -exec unlink {} \;

if [ -f package.json ] ; then
# We still redirect output to /dev/null because even with the --silent flag, yarn still gives sass output such as
# $ sass themes/pmahomme/scss:themes/pmahomme/css themes/original/scss:themes/original/css themes/metro/scss:themes/metro/css
Expand All @@ -111,6 +116,8 @@ for REPONAME in $REPOS ; do
fi
done

echo "Updating themes"

# Clone / update themes
if [ -d $BASEDIR/themes/.git ] ; then
cd $BASEDIR/themes
Expand All @@ -119,6 +126,8 @@ else
git clone $REMOTE_THEMES $BASEDIR/themes
fi

echo "Deleting stale directories"

# Delete stale directories
find $BASEDIR -maxdepth 1 -mindepth 1 -type d | while read DIRNAME ; do
REPO=${DIRNAME##*/}
Expand All @@ -133,3 +142,5 @@ find $BASEDIR -maxdepth 1 -mindepth 1 -type d | while read DIRNAME ; do
echo "Deleting stale repository $DIRNAME"
rm -rf "$DIRNAME"
done

echo "All done"

0 comments on commit 249f5c1

Please sign in to comment.