-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3 from DuncanMcPherson/autoMocker-init
Auto mocker init
- Loading branch information
Showing
3 changed files
with
33 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
const fs = require("fs") | ||
|
||
// DO NOT DELETE THIS FILE | ||
|
||
function main() { | ||
const source = fs.readFileSync("C:/Users/Duncan McPherson/WebstormProjects/karma-test-utils/package.json").toString("utf-8"); | ||
const sourceObj = JSON.parse(source); | ||
const version = sourceObj.version; | ||
|
||
const versionParts = version.split('.'); | ||
let patchVersion = +versionParts[2]; | ||
let minorVersion = +versionParts[1]; | ||
let majorVersion = +versionParts[0]; | ||
if (patchVersion++ >= 10) { | ||
minorVersion++; | ||
patchVersion = 0; | ||
} | ||
if (minorVersion === 10) { | ||
majorVersion++; | ||
minorVersion = 0; | ||
} | ||
const newVersion = `${majorVersion}.${minorVersion}.${patchVersion}` | ||
sourceObj.version = newVersion; | ||
console.log("new version:", newVersion) | ||
fs.writeFileSync("C:/Users/Duncan McPherson/WebstormProjects/karma-test-utils/package.json", Buffer.from(JSON.stringify(sourceObj, null, 2), "utf-8")); | ||
} | ||
|
||
main(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters