element-web/scripts/package.sh

26 lines
436 B
Bash
Raw Normal View History

#!/bin/sh
set -e
dev=""
2016-11-11 18:07:03 +00:00
if [ "$1" = '-d' ]; then
dev=":dev"
fi
if [ -n "$DIST_VERSION" ]; then
version=$DIST_VERSION
2016-11-02 11:38:11 +00:00
else
version=`git describe --dirty --tags || echo unknown`
fi
npm run clean
npm run build$dev
mkdir -p dist
cp -r webapp vector-$version
echo $version > vector-$version/version
tar chvzf dist/vector-$version.tar.gz vector-$version
rm -r vector-$version
echo
echo "Packaged dist/vector-$version.tar.gz"