Skip to content

Instantly share code, notes, and snippets.

@smorcuend
Last active September 3, 2019 16:28
Show Gist options
  • Select an option

  • Save smorcuend/c37e89ec5a7078ec349d91e9bef71eca to your computer and use it in GitHub Desktop.

Select an option

Save smorcuend/c37e89ec5a7078ec349d91e9bef71eca to your computer and use it in GitHub Desktop.

Revisions

  1. Sergio Morcuende revised this gist Sep 3, 2019. 1 changed file with 9 additions and 0 deletions.
    9 changes: 9 additions & 0 deletions package.json.piece
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,9 @@
    "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';"
  2. Sergio Morcuende created this gist Sep 3, 2019.
    15 changes: 15 additions & 0 deletions version.js
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,15 @@

    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)}`);