Permalink
Browse files

initial commit

  • Loading branch information...
0 parents commit 104e606c1628b1cda13b4afeeaf1525318330619 @jaubourg committed Oct 15, 2012
Showing with 117 additions and 0 deletions.
  1. +2 −0 .gitignore
  2. +22 −0 LICENSE-MIT
  3. +32 −0 grunt.js
  4. +36 −0 package.json
  5. +25 −0 tasks/update-submodules.js
@@ -0,0 +1,2 @@
+.DS_Store
+node_modules/
@@ -0,0 +1,22 @@
+Copyright (c) 2012 Julian Aubourg <j@ubourg.net>
+
+Permission is hereby granted, free of charge, to any person
+obtaining a copy of this software and associated documentation
+files (the "Software"), to deal in the Software without
+restriction, including without limitation the rights to use,
+copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the
+Software is furnished to do so, subject to the following
+conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,32 @@
+module.exports = function(grunt) {
+
+
+  // Project configuration.
+  grunt.initConfig({
+    pkg: "<json:package.json>",
+    lint: {
+      files: [ "grunt.js", "tasks/**/*.js" ]
+    },
+    jshint: {
+      options: {
+        curly: true,
+        eqeqeq: true,
+        immed: true,
+        latedef: true,
+        newcap: true,
+        noarg: true,
+        sub: true,
+        undef: true,
+        boss: true,
+        eqnull: true,
+        node: true,
+        es5: true
+      },
+      globals: {}
+    }
+  });
+
+  // Default task.
+  grunt.registerTask("default", "lint");
+
+};
@@ -0,0 +1,36 @@
+{
+ "name": "grunt-update-submodules",
+ "description": "Updates git submodules",
+ "version": "0.1.0",
+ "homepage": "https://github.com/jaubourg/grunt-update-submodules",
+ "author": "Julian Aubourg <j@ubourg.net>",
+ "repository": {
+ "type": "git",
+ "url": "git://github.com/jaubourg/grunt-update-submodules.git"
+ },
+ "bugs": {
+ "url": "https://github.com/jaubourg/grunt-update-submodules/issues"
+ },
+ "licenses": [
+ {
+ "type": "MIT",
+ "url": "https://github.com/jaubourg/grunt-update-submodules/blob/master/LICENSE-MIT"
+ }
+ ],
+ "main": "grunt.js",
+ "bin": "bin/grunt-update-submodules",
+ "engines": {
+ "node": "*"
+ },
+ "dependencies": {
+ "grunt": "~0.3.5"
+ },
+ "devDependencies": {
+ "grunt": "~0.3.5"
+ },
+ "keywords": [
+ "git",
+ "submodule",
+ "update"
+ ]
+}
@@ -0,0 +1,25 @@
+module.exports = function( grunt ) {
+ grunt.registerTask( "update-submodules", function() {
+ var done = this.async(),
+ cp = require("child_process");
+ grunt.verbose.writeln( "Updating submodules..." );
+ cp.exec( "git submodule", function( err, stdout, stderr ) {
+ if ( err || stderr ) {
+ grunt.verbose.error();
+ done( err || stderr );
+ return;
+ }
+ var cmd = "git submodule update --init --recursive" +
+ ( /(?:^|\n)-/.test( stdout ) ? "" : " --merge" );
+ grunt.verbose.writeln( cmd );
+ cp.exec( cmd, function( err, stdout, stderr ) {
+ if ( err || stderr ) {
+ grunt.verbose.error();
+ done( err || stderr );
+ return;
+ }
+ done();
+ });
+ });
+ });
+};

0 comments on commit 104e606

Please sign in to comment.