Permalink
Browse files

task for versioning of son files

  • Loading branch information...
1 parent ac93c80 commit 2a69b1886b599133997f6ec328bed0c5098285e6 Adam Draper committed Dec 21, 2016
Showing with 33 additions and 9 deletions.
  1. +28 −6 Gruntfile.js
  2. +1 −1 bower.json
  3. +1 −1 component.json
  4. +3 −1 package.json
View
@@ -44,6 +44,8 @@ module.exports = function(grunt) {
grunt.file.write('numeral.js', numeral);
};
+ require('load-grunt-tasks')(grunt);
+
grunt.initConfig({
mochaTest : {
all: [
@@ -152,12 +154,6 @@ module.exports = function(grunt) {
}
});
- grunt.loadNpmTasks('grunt-contrib-copy');
- grunt.loadNpmTasks('grunt-contrib-uglify');
- grunt.loadNpmTasks('grunt-contrib-jshint');
- grunt.loadNpmTasks('grunt-mocha-test');
- grunt.loadNpmTasks('grunt-karma');
-
grunt.registerTask('default', [
'test'
]);
@@ -194,6 +190,32 @@ module.exports = function(grunt) {
'uglify'
]);
+ grunt.registerTask('version', function (version) {
+ if (!version || version.split('.').length !== 3) {
+ grunt.fail.fatal('malformed version. Use\n\n grunt version:1.2.3');
+ }
+
+ grunt.config('string-replace.json', {
+ files: {
+ 'package.json': 'package.json',
+ 'component.json': 'component.json',
+ 'bower.json': 'bower.json'
+ },
+ options: {
+ replacements: [
+ {
+ pattern: /"version": .*/,
+ replacement: '"version": "' + version + '",'
+ }
+ ]
+ }
+ });
+
+ grunt.task.run([
+ 'string-replace:json'
+ ]);
+ });
+
// Travis CI task.
grunt.registerTask('travis', [
'build',
View
@@ -1,7 +1,7 @@
{
"name": "numeral",
"repo": "adamwdraper/Numeral-js",
- "version": "2.0.3",
+ "version": "2.0.4",
"description": "Format and manipulate numbers.",
"keywords": [
"numeral",
View
@@ -1,7 +1,7 @@
{
"name": "numeral",
"repo": "adamwdraper/Numeral-js",
- "version": "2.0.3",
+ "version": "2.0.4",
"description": "Format and manipulate numbers.",
"keywords": [
"numeral",
View
@@ -1,6 +1,6 @@
{
"name": "numeral",
- "version": "2.0.3",
+ "version": "2.0.4",
"description": "Format and manipulate numbers.",
"homepage": "http://numeraljs.com",
"author": {
@@ -38,13 +38,15 @@
"grunt-karma": "^2.0.0",
"grunt-mocha-test": "^0.13.2",
"grunt-saucelabs": "*",
+ "grunt-string-replace": "^1.3.1",
"karma": "^1.3.0",
"karma-chai": "^0.1.0",
"karma-chrome-launcher": "^2.0.0",
"karma-firefox-launcher": "^1.0.0",
"karma-mocha": "^1.3.0",
"karma-mocha-reporter": "^2.2.1",
"karma-sauce-launcher": "^1.1.0",
+ "load-grunt-tasks": "^3.5.2",
"mocha": "^3.1.2",
"uglify-js": "latest"
},

0 comments on commit 2a69b18

Please sign in to comment.