diff --git a/scripts/build b/scripts/build index 40c2a67..bc9dc04 100755 --- a/scripts/build +++ b/scripts/build @@ -63,6 +63,7 @@ cp -R node_modules/bootstrap/dist/** ${DIST} # Patch bootstrap.css to remove source mapping URL comment sed -i.bak -e "s@/\*# sourceMappingURL=bootstrap\.css\.map.*@@g" ${DIST}/css/bootstrap.css +rm -f ${DIST}/css/bootstrap.css.bak # Generate css cat ./node_modules/bootstrap/dist/css/bootstrap.css \ @@ -86,6 +87,12 @@ tar -cvzf ./dist/${VERSION}.tar.gz -C ${DIST} . # Copy index.html for testing sed -e "s/VERSION/"${VERSION}"/g" ./index.html.tmpl > ./dist/index.html +# Generate versions file +COMMIT=$(git rev-parse --short HEAD) +sed -e "s/VERSION/"${VERSION}"/g" ./version.json.tmpl > ${DIST}/version.json +sed -i.bak -e "s/COMMIT/"${COMMIT}"/g" ${DIST}/version.json +rm -f ${DIST}/version.json.bak + echo "" echo "All done" echo "" \ No newline at end of file diff --git a/version.json.tmpl b/version.json.tmpl new file mode 100644 index 0000000..b4e67ea --- /dev/null +++ b/version.json.tmpl @@ -0,0 +1,4 @@ +{ + "version": "VERSION", + "commit": "COMMIT" +} \ No newline at end of file