Skip to content

Instantly share code, notes, and snippets.

@smorcuend
Last active September 3, 2019 16:28
Show Gist options
  • Save smorcuend/c37e89ec5a7078ec349d91e9bef71eca to your computer and use it in GitHub Desktop.
Save smorcuend/c37e89ec5a7078ec349d91e9bef71eca to your computer and use it in GitHub Desktop.
Angular scripts for bumping code
"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';"
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