forked from cerc-io/assemblyscript
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpostversion.js
More file actions
18 lines (16 loc) · 513 Bytes
/
postversion.js
File metadata and controls
18 lines (16 loc) · 513 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
const fs = require("fs");
const path = require("path");
// Make sure that we are not publishing a v1 just yet
const mainPkg = require("../package.json");
if (!/^0\./.test(mainPkg.version)) {
throw Error("Unexpected version: " + mainPkg.version);
}
// Sync lib with main package
[
"lib/loader"
].forEach(dir => {
const pkgFile = path.join(__dirname, "..", dir, "package.json");
const pkg = require(pkgFile);
pkg.version = mainPkg.version;
fs.writeFileSync(pkgFile, JSON.stringify(pkg, null, 2));
});