Last active
September 3, 2019 16:28
-
-
Save smorcuend/c37e89ec5a7078ec349d91e9bef71eca to your computer and use it in GitHub Desktop.
Angular scripts for bumping code
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
"release:changelog": "npm run conventional-changelog -- -p angular-bitbucket -i CHANGELOG.md -s -r 0", | |
"report-coverage": "codecov", | |
"preversion": "git checkout master && git pull origin master --tags", | |
"version": "npm run release:changelog && git add CHANGELOG.md package.json", | |
"postversion": "rm -rf dist/", | |
"bump": "npm run bump:patch", | |
"bump:patch": "npm version patch -m 'Bump version: %s';", | |
"bump:minor": "npm version minor -m 'Bump version: %s';", | |
"bump:major": "npm version major -m 'Bump version: %s';" |
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 { resolve, relative } = require('path'); | |
const { writeFileSync } = require('fs-extra'); | |
const gitInfo = { | |
tag: require('./package.json').version | |
}; | |
const versionInfoJson = JSON.stringify(gitInfo, null, 2); | |
const file = resolve(__dirname, 'git-version.json'); | |
writeFileSync(file, versionInfoJson, { encoding: 'utf-8' }); | |
// tslint:disable-next-line:no-console | |
console.log(`Wrote version info ${gitInfo.raw} to ${relative(resolve(__dirname, '..'), file)}`); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment