Skip to content

Commit

Permalink
Use globals for version bump
Browse files Browse the repository at this point in the history
  • Loading branch information
pateketrueke committed May 31, 2017
1 parent 6599e1f commit 2d9a530
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 3 deletions.
14 changes: 14 additions & 0 deletions build/VERSION
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/bin/sh

VERSION="$(cat package.json | grep '"version":')"
VERSION=${VERSION##*:}
VERSION=${VERSION%,*}
VERSION=$(echo $VERSION | sed 's/"//g')

SEARCH='("version":[[:space:]]*").+(")'
REPLACE="\1${VERSION}\2"

sed -i ".tmp" -E "s/${SEARCH}/${REPLACE}/g" bower.json
rm *.tmp

echo $VERSION
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
"main": "lib/index.js",
"scripts": {
"dist": "yarn build && yarn build:dist",
"build": "tarima -qfe dist",
"build:dist": "node build/dist.js",
"build": "tarima -qfe dist VERSION=`./build/VERSION`",
"build:dist": "yarn build && node build/dist.js",
"test": "yarn test:lint && yarn build && yarn test:unit && yarn test:schema",
"test:lint": "tslint ts/**/*.ts",
"test:unit": "jasmine-node spec/unit --noStackTrace --captureExceptions",
Expand Down
4 changes: 3 additions & 1 deletion ts/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,8 @@ jsf.locate = function(name: string) {
return container.get(name);
};

jsf.version = '0.5.0-rc3';
/* global VERSION */

jsf.version = VERSION;

export default jsf;

0 comments on commit 2d9a530

Please sign in to comment.