0.3.0 • Published 9 years ago

verify-git-tag v0.3.0

Weekly downloads
3
License
MIT
Repository
github
Last release
9 years ago

verify-git-tag

A simple tool to verify the existence of git remote tag to be the same as the package.json version. To be used while publishing.

Installation

npm install verify-git-tag --save-dev

Recommended usage - CLI

Use it with in-publish.

pacakge.json:

{
  "scripts": {
    "prepublish": "in-publish && verify-git-tag || in-install"
  }
}

CLI Options

-r | --remote <remote>

Default remote is origin. Use this to specify remote to fetch tags from

$ verify-git-tag -r upstream

-v | --verbose

On success,

$ verify-git-tag -v
[verify-git-tag] tag v0.1.0 exists

On failure,

$ verify-git-tag -v
[verify-git-tag] tag v0.1.1 does not exist
[verify-git-tag] git tag v0.1.1 && git push --tags

NodeJS API - Usage

Returns a promise that resolves with { version, exists }

Example

var verifyGitTag = require('verify-git-tag');
verifyGitTag({
  remote: 'upstream' // default is origin if not specified
}).then(function(result) {
  console.log(result);
  // => result.version: <String> version from package.json
  // => result.exists: <Boolean> git tag exists
}).catch(function(err) {
  console.error(err);
});
0.3.0

9 years ago

0.2.0

9 years ago

0.1.1

9 years ago

0.1.0

9 years ago

0.0.1

9 years ago

0.0.0

9 years ago