You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by fi...@apache.org on 2013/07/03 00:42:31 UTC

[1/2] git commit: updated contributor list.

Updated Branches:
  refs/heads/master2 627b23b83 -> cbbc7b6a7


updated contributor list.


Project: http://git-wip-us.apache.org/repos/asf/cordova-cli/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-cli/commit/20447ea1
Tree: http://git-wip-us.apache.org/repos/asf/cordova-cli/tree/20447ea1
Diff: http://git-wip-us.apache.org/repos/asf/cordova-cli/diff/20447ea1

Branch: refs/heads/master2
Commit: 20447ea137419eea5e191993cb5215dd5495ca0e
Parents: 627b23b
Author: Fil Maj <ma...@gmail.com>
Authored: Tue Jul 2 14:29:18 2013 -0700
Committer: Fil Maj <ma...@gmail.com>
Committed: Tue Jul 2 14:29:18 2013 -0700

----------------------------------------------------------------------
 package.json | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/20447ea1/package.json
----------------------------------------------------------------------
diff --git a/package.json b/package.json
index cf5acd2..663835b 100644
--- a/package.json
+++ b/package.json
@@ -59,7 +59,17 @@
     {"name": "Gord Tanner", "email":"gtanner@gmail.com"},
     {"name": "Tim Kim", "email": "timk@adobe.com"},
     {"name": "Benn Mapes", "email": "Benn.Mapes@gmail.com"},
-    {"name": "Michael Wolf", "email": "Michael.Wolf@Cynergy.com"}
+    {"name": "Michael Wolf", "email": "Michael.Wolf@Cynergy.com"},
+    {"name": "Andrew Grieve", "email": "agrieve@chromium.org"},
+    {"name": "Bryan Higgins", "email": "bhiggins@blackberry.com"},
+    {"name": "Don Coleman", "email": "dcoleman@chariotsolutions.com"},
+    {"name": "Germano Gabbianelli", "email": "tyron.mx@gmail.com"},
+    {"name": "Ian Clelland", "email": "iclelland@chromium.org"},
+    {"name": "Lucas Holmqust", "email": "lholmqui@redhat.com"},
+    {"name": "Matt LeGrand", "email": "mlegrand@gmail.com"},
+    {"name": "Michal Mocny", "email": "mmocny@gmail.com"},
+    {"name": "Sam Breed", "email": "sam@quickleft.com"},
+    {"name": "Tommy-Carlos Williams", "email": "tommy@devgeeks.org"}
   ],
   "license": "Apache version 2.0"
 }


[2/2] git commit: [CB-4002] Dont fire hooks or recurse into directories that begin with a dot.

Posted by fi...@apache.org.
[CB-4002] Dont fire hooks or recurse into directories that begin with a dot.


Project: http://git-wip-us.apache.org/repos/asf/cordova-cli/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-cli/commit/cbbc7b6a
Tree: http://git-wip-us.apache.org/repos/asf/cordova-cli/tree/cbbc7b6a
Diff: http://git-wip-us.apache.org/repos/asf/cordova-cli/diff/cbbc7b6a

Branch: refs/heads/master2
Commit: cbbc7b6a708a7bb692b14cd4c78a1d3ae76b0839
Parents: 20447ea
Author: Fil Maj <ma...@gmail.com>
Authored: Tue Jul 2 15:42:24 2013 -0700
Committer: Fil Maj <ma...@gmail.com>
Committed: Tue Jul 2 15:42:24 2013 -0700

----------------------------------------------------------------------
 spec/hooker.spec.js | 98 ++++++++++++++++++++++++------------------------
 src/hooker.js       |  4 +-
 2 files changed, 52 insertions(+), 50 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/cbbc7b6a/spec/hooker.spec.js
----------------------------------------------------------------------
diff --git a/spec/hooker.spec.js b/spec/hooker.spec.js
index a85fc88..4711b17 100644
--- a/spec/hooker.spec.js
+++ b/spec/hooker.spec.js
@@ -107,61 +107,61 @@ describe('hooker', function() {
         });
 
         describe('success', function() {
-            it('should execute all scripts in order and fire callback', function(done) {
-                var hook = path.join(tempDir, '.cordova', 'hooks', 'before_build');
-                shell.mkdir('-p', hook);
-                this.after(function() { shell.rm('-rf', tempDir); });
-                if (platform.match(/(win32|win64)/)) {
-                    shell.cp(path.join(hooks, 'test', '0.bat'), hook);
-                    shell.cp(path.join(hooks, 'test', '1.bat'), hook);
-                } else {
-                    shell.cp(path.join(hooks, 'test', '0.sh'), hook);
-                    shell.cp(path.join(hooks, 'test', '1.sh'), hook);
-                }
-                fs.readdirSync(hook).forEach(function(script) {
-                    fs.chmodSync(path.join(hook, script), '754');
-                });
-                var returnValue;
-                var s = spyOn(shell, 'exec').andCallFake(function(cmd, opts, cb) {
-                    cb(0, '');
-                });
-                h.fire('before_build', function(err) {
-                    expect(err).not.toBeDefined();
+            describe('project-level hooks', function() {
+                var hook = path.join(tempDir, '.cordova', 'hooks', 'before_build'),
+                    s;
+                beforeEach(function() {
+                    shell.mkdir('-p', hook);
                     if (platform.match(/(win32|win64)/)) {
-                        expect(s.calls[0].args[0]).toMatch(/0.bat/);
-                        expect(s.calls[1].args[0]).toMatch(/1.bat/);
+                        shell.cp(path.join(hooks, 'test', '0.bat'), hook);
+                        shell.cp(path.join(hooks, 'test', '1.bat'), hook);
                     } else {
-                        expect(s.calls[0].args[0]).toMatch(/0.sh/);
-                        expect(s.calls[1].args[0]).toMatch(/1.sh/);
+                        shell.cp(path.join(hooks, 'test', '0.sh'), hook);
+                        shell.cp(path.join(hooks, 'test', '1.sh'), hook);
                     }
-                    done();
+                    fs.readdirSync(hook).forEach(function(script) {
+                        fs.chmodSync(path.join(hook, script), '754');
+                    });
+                    s = spyOn(shell, 'exec').andCallFake(function(cmd, opts, cb) {
+                        cb(0, '');
+                    });
                 });
-            });
-            it('should pass the project root folder as parameter into the project-level hooks', function(done) {
-                var hook = path.join(tempDir, '.cordova', 'hooks', 'before_build');
-                shell.mkdir('-p', hook);
-                this.after(function() { shell.rm('-rf', tempDir); });
-                if (platform.match(/(win32|win64)/)) {
-                    shell.cp(path.join(hooks, 'test', '0.bat'), hook);
-                } else {
-                    shell.cp(path.join(hooks, 'test', '0.sh'), hook);
-                }
-                fs.readdirSync(hook).forEach(function(script) {
-                    fs.chmodSync(path.join(hook, script), '754');
+                afterEach(function() {
+                    shell.rm('-rf', tempDir);
                 });
-                var s = spyOn(shell, 'exec').andCallFake(function(cmd, opts, cb) {
-                    cb(0, '');
+                it('should execute all scripts in order and fire callback', function(done) {
+                    h.fire('before_build', function(err) {
+                        expect(err).not.toBeDefined();
+                        if (platform.match(/(win32|win64)/)) {
+                            expect(s.calls[0].args[0]).toMatch(/0.bat/);
+                            expect(s.calls[1].args[0]).toMatch(/1.bat/);
+                        } else {
+                            expect(s.calls[0].args[0]).toMatch(/0.sh/);
+                            expect(s.calls[1].args[0]).toMatch(/1.sh/);
+                        }
+                        done();
+                    });
                 });
-                h.fire('before_build', function(err) {
-                    expect(err).not.toBeDefined();
-                    var param_str;
-                    if (platform.match(/(win32|win64)/)) {
-                        param_str = '0.bat "'+tempDir+'"';
-                    } else { 
-                        param_str = '0.sh "'+tempDir+'"'; 
-                    }
-                    expect(s.calls[0].args[0].indexOf(param_str)).not.toEqual(-1);
-                    done();
+                it('should pass the project root folder as parameter into the project-level hooks', function(done) {
+                    h.fire('before_build', function(err) {
+                        expect(err).not.toBeDefined();
+                        var param_str;
+                        if (platform.match(/(win32|win64)/)) {
+                            param_str = '0.bat "'+tempDir+'"';
+                        } else { 
+                            param_str = '0.sh "'+tempDir+'"'; 
+                        }
+                        expect(s.calls[0].args[0].indexOf(param_str)).not.toEqual(-1);
+                        done();
+                    });
+                });
+                it('should skip any files starting with a dot on the scripts', function(done) {
+                    shell.cp(path.join(hooks, 'test', '0.bat'), path.join(hook, '.swp.file'));
+                    h.fire('before_build', function(err) {
+                        expect(err).not.toBeDefined();
+                        expect(s).not.toHaveBeenCalledWith(path.join(tempDir, '.cordova', 'hooks', 'before_build', '.swp.file') + ' "' + tempDir + '"', jasmine.any(Object), jasmine.any(Function));
+                        done();
+                    });
                 });
             });
             describe('module-level hooks', function() {

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/cbbc7b6a/src/hooker.js
----------------------------------------------------------------------
diff --git a/src/hooker.js b/src/hooker.js
index b5e39d4..eb27f50 100644
--- a/src/hooker.js
+++ b/src/hooker.js
@@ -57,7 +57,9 @@ module.exports.prototype = {
             if (!(fs.existsSync(dir))) {
                 callback(); // hooks directory got axed post-create; ignore.
             } else {
-                var scripts = fs.readdirSync(dir);
+                var scripts = fs.readdirSync(dir).filter(function(s) {
+                    return s[0] != '.';
+                });
                 execute_scripts_serially(scripts, self.root, dir, function(err) {
                     if (err) {
                         callback(err);