Update upstream update scripts

* Allow to run any directory
* Leaving stuff on /tmp was not nice
* Git pull was run on wrong directory

Change-Id: Ia7f82de55c9bd446c29afc0684660ed00b6585bf
This commit is contained in:
Niklas Laxström
2016-04-15 07:47:23 +02:00
parent 3cfb0d67e5
commit 1a378e3cca
4 changed files with 65 additions and 43 deletions

View File

@@ -1,17 +1,22 @@
#!/bin/bash
DEST="../lib/";
CLONEDIR="/tmp/jquery.webfonts";
HERE=$(pwd);
UPSTREAM="https://github.com/wikimedia/jquery.webfonts.git";
BASEDIR=$(dirname "$0")
BASEDIR="$BASEDIR/.."
echo -e "Getting latest jquery.webfonts from $UPSTREAM\n";
DEST="$BASEDIR/lib/"
CLONEDIR="$BASEDIR/vendor/jquery.wefonts"
if [ -d $CLONEDIR ]; then
git pull;
UPSTREAM="https://github.com/wikimedia/jquery.webfonts.git"
echo "Getting latest jquery.wefonts from $UPSTREAM"
if [ -d "$CLONEDIR" ]; then
pushd "$CLONEDIR"
git pull
popd
else
git clone $UPSTREAM $CLONEDIR;
git clone "$UPSTREAM" "$CLONEDIR"
fi
cd "$HERE";
cp -rf $CLONEDIR/src/* $DEST
rm -rf "$DEST/jquery.webfonts.js"
cp -R "$CLONEDIR/src/jquery.webfonts.js" "$DEST/jquery.webfonts.js"