-
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.
e Updated gittey config with new aliases
- Loading branch information
Showing
2 changed files
with
42 additions
and
0 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,34 @@ | ||
// npm verison bump broke. This is a quick patch. | ||
const childProcess = require('child_process'); | ||
const fs = require('fs'); | ||
|
||
const packageData = require('./package.json'); | ||
|
||
const versionTokens = packageData.version.split('.').map(value => parseInt(value, 10)); | ||
|
||
const [rawVersionType] = process.argv.slice(2); | ||
|
||
const versionType = rawVersionType.toLowerCase(); | ||
|
||
if (versionType === 'patch') { | ||
versionTokens[2]++; | ||
} else if (versionType === 'minor') { | ||
versionTokens[1]++; | ||
versionTokens[2] = 0; | ||
} else if (versionType === 'major') { | ||
versionTokens[0]++; | ||
versionTokens[1] = 0; | ||
versionTokens[2] = 0; | ||
} | ||
|
||
const versionString = versionTokens.join('.'); | ||
|
||
packageData.version = versionString; | ||
|
||
fs.writeFileSync( | ||
'./package.json', | ||
JSON.stringify(packageData, null, 4), | ||
{ encoding: 'utf8' }); | ||
|
||
childProcess.execSync(`git commit -am "New version, ${versionString}"`); | ||
childProcess.execSync(`git tag v${versionString}`); |