1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2024-11-23 18:17:20 +00:00
TiddlyWiki5/bin/get-version-number
Jermolene 14623d33d2 CI: Fixes
Things are starting to work now...

* Now we extract the version number from package.json to use in making the plugin library
* We start building the whole site (eek, going to be slow)
2019-01-07 20:07:32 +00:00

19 lines
522 B
JavaScript
Executable File

#!/usr/bin/env node
// Extract raw version number from package.json (without the optional "-prerelease" suffix)
if(!process.env["TW5_BUILD_TIDDLYWIKI"]) {
throw "TW5_BUILD_TIDDLYWIKI environment variable not set";
}
var fs = require("fs"),
path = require("path");
var json = JSON.parse(fs.readFileSync(path.resolve(path.dirname(process.env["TW5_BUILD_TIDDLYWIKI"]),"./package.json"),"utf8"));
if(!json.version) {
throw "Missing version number in package.json";
}
process.stdout.write(json.version.split("-")[0]);