From a4c57aa9d6724ca5f827653174576ae1d6cb4bf0 Mon Sep 17 00:00:00 2001 From: Cam Saul <cam@geotip.com> Date: Mon, 28 Sep 2015 16:25:36 -0700 Subject: [PATCH] generate a version.js file --- build-uberjar | 9 ++++++--- resources/frontend_client/app/version.js.template | 11 +++++++++++ 2 files changed, 17 insertions(+), 3 deletions(-) create mode 100644 resources/frontend_client/app/version.js.template diff --git a/build-uberjar b/build-uberjar index 027bf90d686..52d8dcc8d16 100755 --- a/build-uberjar +++ b/build-uberjar @@ -15,10 +15,13 @@ generate_version_info() { fi # Ok, now generate the appropriate file. Ha! we are ghetto - cat src/metabase/version.clj.template | perl -pe "s/{{VERSION}}/$LATEST_TAG/" > src/metabase/version.clj + TEMPLATES="src/metabase/version.clj resources/frontend_client/app/version.js" + for template in $TEMPLATES; do + cat "$template.template" | perl -pe "s/{{VERSION}}/$LATEST_TAG/" > $template - # We don't want these version changes being passed along to master so tell git to ignore them - git update-index --assume-unchanged src/metabase/version.clj + # We don't want these version changes being passed along to master so tell git to ignore them + git update-index --assume-unchanged $template + done fi } diff --git a/resources/frontend_client/app/version.js.template b/resources/frontend_client/app/version.js.template new file mode 100644 index 00000000000..25d548f2701 --- /dev/null +++ b/resources/frontend_client/app/version.js.template @@ -0,0 +1,11 @@ +// -*- mode: javascript; -*- +// +// ************************************************************ +// * WARNING: DO NOT EDIT VERSION.JS DIRECTLY! * +// * VERSION.JS IS AUTOMATICALLY GENERATED BY A PERL SCRIPT. * +// * INSTEAD, EDIT VERSION.JS.TEMPLATE. * +// ************************************************************ + +'use strict'; + +var METABASE_VERSION = "{{VERSION}}"; -- GitLab