Fixed drush and node_modules/*.info file conflict
authorPeter Haight <peterh@giantrabbit.com>
Wed, 31 Dec 2014 02:04:16 +0000 (18:04 -0800)
committerPeter Haight <peterh@giantrabbit.com>
Wed, 31 Dec 2014 02:04:16 +0000 (18:04 -0800)
Tim noticed that drush doesn't work when node_modules directory exists.
People say that it's because of the *.info files that some things have
in node_modules and suggested adding a line to the npm postinstall
script to remove  any *.info files from there because they aren't really
needed to run stuff. Because we are already doing brower install in the
postinstall script, I broke the postinstall stuff into a separate
script and put both things in there.

bin/npm_postinstall.sh [new file with mode: 0644]
package.json

diff --git a/bin/npm_postinstall.sh b/bin/npm_postinstall.sh
new file mode 100644 (file)
index 0000000..9308d36
--- /dev/null
@@ -0,0 +1,2 @@
+find node_modules/ -name '*.info' -type f -delete
+node node_modules/bower/bin/bower install
index 386b8cca1891cb24c5a7f2932e776b6f4c703498..51a99add26b1751149d4d15b6e8be993fdea3740 100644 (file)
@@ -12,7 +12,7 @@
     "karma-jasmine": "~0.3.2"
   },
   "scripts": {
-    "postinstall": "node node_modules/bower/bin/bower install",
+    "postinstall": "bash bin/npm_postinstall.sh",
     "test": "node node_modules/karma/bin/karma start tests/karma.conf.js"
   }
 }