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

grunt-gitrevision

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

grunt-gitrevision - npm Package Compare versions

Comparing version 0.1.0 to 0.1.1

9

Gruntfile.js

@@ -33,2 +33,11 @@ /*

}
},
custom_options: {
options: {
revisionPrefix: ' (Build ',
revisionSuffix: ')'
},
files: {
'tmp/custom.js': ['test/fixtures/testing.js']
}
}

@@ -35,0 +44,0 @@ }

2

package.json
{
"name": "grunt-gitrevision",
"description": "Grunt task to add version and Git's revision information to your project files.",
"version": "0.1.0",
"version": "0.1.1",
"homepage": "https://github.com/miwurster/grunt-gitrevision",

@@ -6,0 +6,0 @@ "author": {

@@ -22,2 +22,3 @@ # grunt-gitrevision

## Getting Started

@@ -62,3 +63,3 @@

#### options.prefix
#### options.versionPattern
Type: `String`

@@ -69,2 +70,15 @@ Default value: `'[^\\-]version[\'"]?\\s*[:=]\\s*[\'"]'`

#### options.revisionPrefix
Type: `String`
Default value: `'-r'`
A string value prefixing the revision number.
#### options.revisionSuffix
Type: `String`
Default value: `''`
A string value which should be appended to the revision information.
### Usage Examples

@@ -71,0 +85,0 @@

@@ -20,4 +20,6 @@ /*

var options = this.options({
prefix: '[^\\-]version[\'"]?\\s*[:=]\\s*[\'"]',
replace: '[0-9a-zA-Z\\-_\\+\\.]+'
versionPattern: '[^\\-]version[\'"]?\\s*[:=]\\s*[\'"]',
replacePattern: '[0-9a-zA-Z\\-_\\+\\.]+',
revisionPrefix: '-r',
revisionSuffix: ''
});

@@ -47,3 +49,3 @@

var revision = stdout.replace(/(\r\n|\n|\r)/gm, "");
var version = pkg.version + '-b' + revision;
var version = pkg.version + options.revisionPrefix + revision + options.revisionSuffix;

@@ -53,3 +55,3 @@ var content = grunt.file.read(filepath);

// Apply the version string to the src file
var pattern = new RegExp('(' + options.prefix + ')(' + options.replace + ')', 'g');
var pattern = new RegExp('(' + options.versionPattern + ')(' + options.replacePattern + ')', 'g');
var output = content.replace(pattern, '$1' + version);

@@ -56,0 +58,0 @@

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