GITREPO="highlight.js"
GITURL="git://github.com/isagalaev/highlight.js.git"
build-script() {
local BUILDFILE=`ls tools/build.*`
if [[ $BUILDFILE == "tools/build.py" ]]; then
local RUN=`which python3`
else
local RUN=`which nodejs || which node`
npm install
fi
$RUN $BUILDFILE $*
}
git fetch origin
git merge origin/master
if [[ ! -d $GITREPO ]]; then
git clone $GITURL $GITREPO --depth 10
fi
cd $GITREPO
TAGNAME=`git tag --list | sort --reverse | head -n 1`
BUILDDIR="../build"
git pull
git checkout $TAGNAME
rm -rf $BUILDDIR
build-script -t cdn :common
cp -R build $BUILDDIR
git checkout master
cd ..
git add --all
git commit -m "Update to version ${TAGNAME}"
git tag --annotate $TAGNAME -m "Version ${TAGNAME}"
git push origin
git push --tags