Skip to content

Commit

Permalink
GitVersion.yml is used as a source of version.ts (#56)
Browse files Browse the repository at this point in the history
  • Loading branch information
jkanczler authored Sep 22, 2017
1 parent ba72989 commit b6e55db
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
2 changes: 1 addition & 1 deletion GitVersion.yml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
next-version: 3.0.19
next-version: 3.2.0
assembly-informational-format: '{SemVer}'
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@
"tslint": "tslint tasks/webpack-build-task/**/*.ts -e tasks/webpack-build-task/node_modules/**/*",
"build-without-setup": "tsc && npm run tslint",
"build": "npm run setup && npm run build-without-setup",
"release": "npm run build && node updateVersion.js && node node_modules/tfx-cli/_build/tfx-cli.js extension create --manifest-glob vss-extension.json --output-path ./dist",
"update-version": "node updateVersion.js",
"update-version-without-setup": "npm run build-without-setup && npm run update-version",
"release": "npm run build && npm run update-version && node node_modules/tfx-cli/_build/tfx-cli.js extension create --manifest-glob vss-extension.json --output-path ./dist",
"test-reporter": "cd tasks/webpack-build-task && mocha tests/suite.js --reporter mocha-junit-reporter --reporter-options mochaFile=./test-results.xml",
"test": "npm run build-without-setup && cd tasks/webpack-build-task && mocha tests/suite.js"
},
Expand Down
7 changes: 6 additions & 1 deletion version.ts
Original file line number Diff line number Diff line change
@@ -1 +1,6 @@
export default "__GitVersion.SemVer__".replace("GitVersion.SemVer", "3.2.0").replace(/__/g, "");
import * as fs from "fs";
import * as os from "os";

const nextVersion = fs.readFileSync("./GitVersion.yml", "utf-8").split(os.EOL)[0].replace("next-version: ", "");

export default "__GitVersion.SemVer__".replace("GitVersion.SemVer", nextVersion).replace(/__/g, "");

0 comments on commit b6e55db

Please sign in to comment.