New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

git-tag

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

git-tag - npm Package Compare versions

Comparing version 0.1.0 to 0.1.1

47

index.js

@@ -16,5 +16,14 @@ // git-tag

var get = function(cb) {
var cmd = 'git tag -l'
if (options.dir) {
var cmd = 'git -C '+options.dir+' tag -l'
}else{
var cmd = 'git tag -l'
}
if (!options.localOnly) {
cmd = 'git pull origin --tags; ' + cmd
if (options.dir) {
cmd = 'git -C '+options.dir+' pull origin --tags; ' + cmd
}else{
cmd = 'git pull origin --tags; ' + cmd
}
}

@@ -33,5 +42,15 @@ exec(cmd, function(err, res){

msg = typeof msg === 'string' ? msg : ''
var cmd = 'git tag -a ' + name + ' -m "' + msg + '"'
if (options.dir) {
var cmd = 'git -C '+options.dir+' tag -a ' + name + ' -m "' + msg + '"'
}else{
var cmd = 'git tag -a ' + name + ' -m "' + msg + '"'
}
if (!options.localOnly) {
cmd += '; git push origin --tags'
if (options.dir) {
cmd += '; git -C '+options.dir+' push origin --tags'
}else{
cmd += '; git push origin --tags'
}
}

@@ -44,5 +63,14 @@ exec(cmd, function(err){

var remove = function(name, cb) {
var cmd = 'git tag -d ' + name
if (options.dir) {
var cmd = 'git -C '+options.dir+' tag -d ' + name
}else{
var cmd = 'git tag -d ' + name
}
if (!options.localOnly) {
cmd += '; git push origin :refs/tags/' + name
if (options.dir) {
cmd += '; git -C '+options.dir+' push origin :refs/tags/' + name
}else{
cmd += '; git push origin :refs/tags/' + name
}
}

@@ -59,5 +87,4 @@ exec(cmd, function(err){

latest: function(cb) {
get(function(err, res){
if (err) return callback(cb, err, res)
callback(cb, err, res.pop())
exec('git describe --abbrev=0 --tags', function(err, res){
callback(cb, err, res.trim())
})

@@ -67,2 +94,2 @@ }

return Tag
}
}
{
"name": "git-tag",
"version": "0.1.0",
"version": "0.1.1",
"description": "simply command 'git tag' wrapper",

@@ -24,4 +24,4 @@ "main": "index.js",

"dependencies": {
"semver": "~4.2.0"
"semver": "~5.3.0"
}
}

@@ -15,3 +15,3 @@ # git-tag

```javascript
var gitTag = require('git-tag')({localOnly:true})
var gitTag = require('git-tag')({localOnly:true,dir:'/path/to/git/.git'})
```

@@ -22,6 +22,6 @@

```javascript
gitTag.create('0.0.2015', 'just a message',function(res){
gitTag.create('0.0.2015', 'just a message', function(res){
console.log(res) // >> 0.0.2015
})
gitTag.create('0.0.2015', 'just a message',function(err, res){
gitTag.create('0.0.2015', 'just a message', function(err, res){
console.log(err, res) // >> null, 0.0.2015

@@ -28,0 +28,0 @@ })

var assert = require('assert')
var gitTag = require('../')({localOnly:true})
var gitTag = require('../')({localOnly:true,dir:'../.git'})
var async = require('async')

@@ -72,2 +72,2 @@

console.log('test ok.')
})
})
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc