Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Merge pull request #1 from mikesherov/grunt4

Updating to Grunt 0.4
  • Loading branch information...
commit a665cee0ad132aca0a12df0fd3f87cf2882935c6 2 parents 6905240 + 5aef432
Mike Sherov authored December 17, 2012
14  .jshintrc
... ...
@@ -0,0 +1,14 @@
  1
+{
  2
+	"curly": true,
  3
+	"eqeqeq": true,
  4
+	"immed": true,
  5
+	"latedef": true,
  6
+	"newcap": true,
  7
+	"noarg": true,
  8
+	"sub": true,
  9
+	"undef": true,
  10
+	"boss": true,
  11
+	"eqnull": true,
  12
+	"node": true,
  13
+	"es5": true
  14
+}
18  Gruntfile.js
... ...
@@ -0,0 +1,18 @@
  1
+"use strict";
  2
+
  3
+module.exports = function(grunt) {
  4
+
  5
+	grunt.initConfig({
  6
+		jshint: {
  7
+			files: [ "Gruntfile.js", "tasks/**/*.js" ],
  8
+			options: {
  9
+				jshintrc: ".jshintrc"
  10
+			}
  11
+		}
  12
+	});
  13
+
  14
+	// Default task.
  15
+	grunt.registerTask("default", "jshint");
  16
+	grunt.loadNpmTasks("grunt-contrib-jshint");
  17
+	grunt.loadTasks("tasks");
  18
+};
9  README.md
Source Rendered
@@ -4,14 +4,15 @@ Updates git submodules
4 4
 
5 5
 ## Getting Started
6 6
 
7  
-Install this grunt plugin with: `npm install -g grunt-update-submodules`
8  
-
9  
-Then add this to your project's `grunt.js` gruntfile:
10  
-
  7
+Add this to your project's `Gruntfile.js` gruntfile:
11 8
 ```javascript
12 9
 task.loadNpmTasks('grunt-update-submodules');
13 10
 ```
14 11
 
  12
+Then add "grunt-update-submodules" to your package.json dependencies.
  13
+
  14
+Then install the plugin with: `npm install`
  15
+
15 16
 The name to use in your own task definitions is `update_submodules` (with an underscore).
16 17
 
17 18
 ## License
32  grunt.js
... ...
@@ -1,32 +0,0 @@
1  
-module.exports = function(grunt) {
2  
-
3  
-
4  
-  // Project configuration.
5  
-  grunt.initConfig({
6  
-    pkg: "<json:package.json>",
7  
-    lint: {
8  
-      files: [ "grunt.js", "tasks/**/*.js" ]
9  
-    },
10  
-    jshint: {
11  
-      options: {
12  
-        curly: true,
13  
-        eqeqeq: true,
14  
-        immed: true,
15  
-        latedef: true,
16  
-        newcap: true,
17  
-        noarg: true,
18  
-        sub: true,
19  
-        undef: true,
20  
-        boss: true,
21  
-        eqnull: true,
22  
-        node: true,
23  
-        es5: true
24  
-      },
25  
-      globals: {}
26  
-    }
27  
-  });
28  
-
29  
-  // Default task.
30  
-  grunt.registerTask("default", "lint");
31  
-
32  
-};
9  package.json
... ...
@@ -1,7 +1,7 @@
1 1
 {
2 2
 	"name": "grunt-update-submodules",
3 3
 	"description": "Updates git submodules",
4  
-	"version": "0.1.2",
  4
+	"version": "0.2.0",
5 5
 	"homepage": "https://github.com/jaubourg/grunt-update-submodules",
6 6
 	"author": "Julian Aubourg <j@ubourg.net>",
7 7
 	"repository": {
@@ -17,16 +17,17 @@
17 17
 		"url": "https://github.com/jaubourg/grunt-update-submodules/blob/master/LICENSE-MIT"
18 18
 	}
19 19
 	],
20  
-	"main": "grunt.js",
  20
+	"main": "Gruntfile.js",
21 21
 	"bin": "bin/grunt-update-submodules",
22 22
 	"engines": {
23 23
 		"node": "*"
24 24
 	},
25 25
 	"dependencies": {
26  
-		"grunt": "~0.3.5"
  26
+		"grunt": "~0.4.0rc3"
27 27
 	},
28 28
 	"devDependencies": {
29  
-		"grunt": "~0.3.5"
  29
+		"grunt": "~0.4.0rc3",
  30
+		"grunt-contrib-jshint": "~0.1.0"
30 31
 	},
31 32
 	"keywords": [
32 33
 		"git",
10  tasks/update-submodules.js
... ...
@@ -1,8 +1,10 @@
  1
+"use strict";
  2
+
1 3
 module.exports = function( grunt ) {
2 4
 	grunt.registerTask( "update_submodules", function() {
3 5
 		var done = this.async();
4 6
 		grunt.verbose.writeln( "Updating submodules..." );
5  
-		grunt.utils.spawn({
  7
+		grunt.util.spawn({
6 8
 			cmd: "git",
7 9
 			args: [ "submodule" ]
8 10
 		}, function( error, result ) {
@@ -12,9 +14,9 @@ module.exports = function( grunt ) {
12 14
 				return;
13 15
 			}
14 16
 			var args = "submodule update --init --recursive" +
15  
-					( /(?:^|\n)-/.test( result ) ? "" : " --merge" );
  17
+					( /(?:^|\n)-/.test( result.stdout ) ? "" : " --merge" );
16 18
 			grunt.verbose.writeln( "git " + args );
17  
-			grunt.utils.spawn({
  19
+			grunt.util.spawn({
18 20
 				cmd: "git",
19 21
 				args: args.split(" ")
20 22
 			}, function( error ) {
@@ -26,5 +28,5 @@ module.exports = function( grunt ) {
26 28
 				done();
27 29
 			});
28 30
 		});
29  
-	}); 
  31
+	});
30 32
 };

0 notes on commit a665cee

Please sign in to comment.
Something went wrong with that request. Please try again.