forked from microsoftgraph/msgraph-sdk-javascript
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgulpfile.js
More file actions
22 lines (19 loc) · 772 Bytes
/
Copy pathgulpfile.js
File metadata and controls
22 lines (19 loc) · 772 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
const { src, dest, series } = require("gulp");
const replace = require("gulp-replace");
const jsonModify = require("gulp-json-modify");
const argv = require("yargs").argv;
function ReplaceVersionInJson () {
const versionKey = "version";
return src(["../../package.json", "../../package-lock.json"])
.pipe(jsonModify({
key: versionKey,
value: argv.newVersion
}))
.pipe(dest("../../"));
}
function ReplaceVersionInVersionFile () {
return src(["../../src/Version.ts"])
.pipe(replace(/PACKAGE_VERSION ?= ?".*?"/g, `PACKAGE_VERSION = "${argv.newVersion}"`))
.pipe(dest("../../src"));
}
exports.ReplaceVersion = series(ReplaceVersionInJson, ReplaceVersionInVersionFile);