Created
January 18, 2021 03:47
-
-
Save ivanvanderbyl/3e409d09d2c9b691b04afdac925a5800 to your computer and use it in GitHub Desktop.
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
const path = require('path') | |
const semver = require('semver') | |
const fs = require('fs') | |
const prettier = require('prettier') | |
function main() { | |
let manifest = path.resolve('./public/manifest.json') | |
let manifestData = require(manifest) | |
let prevVersion = manifestData.version | |
let latestVersion = semver.parse(prevVersion).inc('patch') | |
process.stderr.write( | |
`INFO: Bumping version from ${prevVersion} to ${latestVersion.version}\n`, | |
) | |
manifestData.version = latestVersion.version | |
return fs.writeFileSync( | |
manifest, | |
prettier.format(JSON.stringify(manifestData), { parser: 'json-stringify' }), | |
) | |
} | |
main() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment