From e5fa02a1d41e2d75755f2e725cef69ba74b81406 Mon Sep 17 00:00:00 2001 From: Boris Grozev Date: Sat, 21 Mar 2015 19:55:48 -0700 Subject: [PATCH] Automates bumping js file versions. Experimental, please revert Makefile if it causes problems. --- .gitignore | 3 ++- Makefile | 2 +- bump-js-versions.sh | 25 +++++++++++++++++++++++++ 3 files changed, 28 insertions(+), 2 deletions(-) create mode 100755 bump-js-versions.sh diff --git a/.gitignore b/.gitignore index 93747a1d0..92772c563 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ node_modules *.swp .idea/ -*.iml \ No newline at end of file +*.iml +.*.tmp diff --git a/Makefile b/Makefile index 6dfb69f72..e37134814 100644 --- a/Makefile +++ b/Makefile @@ -21,4 +21,4 @@ clean: @rm -f $(OUTPUT_DIR)/*.bundle.js deploy: - @mkdir -p $(DEPLOY_DIR) && cp $(OUTPUT_DIR)/*.bundle.js $(DEPLOY_DIR) + @mkdir -p $(DEPLOY_DIR) && cp $(OUTPUT_DIR)/*.bundle.js $(DEPLOY_DIR) && ./bump-js-versions.sh diff --git a/bump-js-versions.sh b/bump-js-versions.sh new file mode 100755 index 000000000..798b9a7b3 --- /dev/null +++ b/bump-js-versions.sh @@ -0,0 +1,25 @@ +#!/bin/sh + +# This script finds all js files included from index.html which have been +# modified and bumps their version (the value of the "v" parameter used +# in index.html) + +# contents of index.html at HEAD (excluding not-committed changes) +index=`git show HEAD:index.html` + +# js files included from index.html. The sort needed for comm +jsfiles=.bump-js-versions-jsfiles.tmp +echo "$index" | grep '