Socket
Socket
Sign inDemoInstall

gulp-tag-version

Package Overview
Dependencies
43
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.3.0 to 1.3.1

.idea/encodings.xml

38

index.js
var map = require('map-stream'),
gutil = require('gulp-util'),
git = require('gulp-git')
log = require('fancy-log'),
colors = require('ansi-colors'),
git = require('gulp-git');

@@ -13,14 +14,18 @@ /**

*/
module.exports = function(opts) {
if(!opts) opts = {}
if(!opts.key) opts.key = 'version'
if(typeof opts.prefix === 'undefined') opts.prefix = 'v'
if(typeof opts.push === 'undefined') opts.push = true
if(typeof opts.label === 'undefined') opts.label = 'Tagging as %t'
module.exports = function (opts) {
if (!opts) opts = {};
if (!opts.key) opts.key = 'version';
if (typeof opts.prefix === 'undefined') opts.prefix = 'v';
if (typeof opts.push === 'undefined') opts.push = true;
if (typeof opts.label === 'undefined') opts.label = 'Tagging as %t';
function modifyContents(file, cb) {
var version = opts.version // OK if undefined at this time
if(!opts.version) {
if(file.isNull()) return cb(null, file)
if(file.isStream()) return cb(new Error('gulp-tag-version: streams not supported'))
var version = opts.version; // OK if undefined at this time
if (!opts.version) {
if (file.isNull()) {
return cb(null, file);
}
if (file.isStream()) {
return cb(new Error('gulp-tag-version: streams not supported'));
}

@@ -30,7 +35,6 @@ var json = JSON.parse(file.contents.toString());

}
var tag = opts.prefix+version
var label = opts.label.replace('%t', tag)
gutil.log('Tagging as: '+gutil.colors.cyan(tag))
git.tag(tag, label, opts)
cb(null, file)
var tag = opts.prefix + version;
var label = opts.label.replace('%t', tag);
log('Tagging as: ' + colors.cyan(tag));
git.tag(tag, label, opts, cb)
}

@@ -37,0 +41,0 @@

{
"name": "gulp-tag-version",
"version": "1.3.0",
"version": "1.3.1",
"description": "Tag git repository with current package version",

@@ -21,13 +21,13 @@ "main": "index.js",

"dependencies": {
"map-stream": "~0.1.0",
"gulp-util": "~2.2.14",
"gulp-git": "~0.3.6"
"ansi-colors": "~1.0.1",
"fancy-log": "~1.3.2",
"gulp-git": "^2.4.2",
"map-stream": "~0.1.0"
},
"devDependencies": {
"gulp": "~3.6.0",
"gulp-bump": "~0.1.7",
"gulp-filter": "~0.4.0",
"gulp-prompt": "~0.1.1",
"gulp": "~3.6.0",
"gulp-git": "~0.3.6"
"gulp-prompt": "~0.1.1"
}
}
gulp-tag-version
================
[![npm](https://img.shields.io/npm/v/gulp-tag-version.svg?maxAge=2592000&style=flat-square)]()
[![npm](https://img.shields.io/npm/dt/gulp-tag-version.svg?maxAge=2592000&style=flat-square)]()
[![npm](https://img.shields.io/npm/dm/gulp-tag-version.svg?maxAge=2592000&style=flat-square)]()
Tag git repository with current package version (gulp plugin).

@@ -13,3 +17,3 @@

var gulp = require('gulp'),
tag_version = require('gulp-tag-version');
tagVersion = require('gulp-tag-version');

@@ -19,3 +23,3 @@ // Assuming there's "version: 1.2.3" in package.json,

gulp.task('tag', function() {
return gulp.src(['./package.json']).pipe(tag_version());
return gulp.src(['./package.json']).pipe(tagVersion());
});

@@ -35,3 +39,3 @@ ```

filter = require('gulp-filter'),
tag_version = require('gulp-tag-version');
tagVersion = require('gulp-tag-version');

@@ -65,3 +69,3 @@ /**

// **tag it in the repository**
.pipe(tag_version());
.pipe(tagVersion());
}

@@ -77,3 +81,3 @@

* If you need any special tagging options to be passed down to `git.tag`, just add it to the `tag_version` options. For example:
* If you need any special tagging options to be passed down to `git.tag`, just add it to the `tagVersion` options. For example:
```js

@@ -86,3 +90,3 @@ gulp.task('bump_submodule', function(){

.pipe(filter('bower.json'))
.pipe(tag_version({cwd: './dist'}));
.pipe(tagVersion({cwd: './dist'}));
});

@@ -95,3 +99,3 @@ ```

...
.pipe(tag_version({version: '1.2.3'}));
.pipe(tagVersion({version: '1.2.3'}));
```

@@ -108,1 +112,3 @@

* To [@brianmhunt](https://github.com/brianmhunt) for suggesting the `version` parameter
* To [@adambuczynski](https://github.com/adambuczynski) for option to customize tag label
* To [@mjeanroy](https://github.com/mjeanroy) for a gulp-util obsoletion update
SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc