Permalink
Browse files

Merge branch 'master' of github.com:paulmillr/chokidar

  • Loading branch information...
2 parents d147db9 + 7af9965 commit 2a36a221658025c4ed775d907e440c1d85fab4c5 @paulmillr committed Feb 23, 2013
Showing with 35 additions and 75 deletions.
  1. +33 −6 .npmignore
  2. +2 −4 package.json
  3. +0 −65 setup.js
View
39 .npmignore
@@ -1,8 +1,35 @@
-.lock-wscript
-.svn/
-.hg/
-.git/
-CVS/
*~
*.bak
-.DS_Store
+*.diff
+*.err
+*.orig
+*.log
+*.rej
+*.swo
+*.swp
+*.vi
+*.sass-cache
+
+.cache
+.project
+.settings
+.tmproj
+nbproject
+
+# Dreamweaver added files
+_notes
+dwsync.xml
+
+# Komodo
+*.komodoproject
+.komodotools
+
+# Folders to ignore
+intermediate
+publish
+.idea
+
+*.sublime-project
+*.sublime-workspace
+
+test/fixtures/subdir/
View
6 package.json
@@ -29,10 +29,8 @@
"node": "~0.6.10 || 0.7 || 0.8 || 0.9"
},
"scripts": {
- "prepublish": "node setup.js prepublish",
- "postpublish": "node setup.js postpublish",
- "test": "node setup.js test",
- "postinstall": "node setup.js test"
+ "prepublish": "coffee -o lib/ src/",
+ "test": "mocha --compilers coffee:coffee-script --require test/common.js --colors"
},
"dependencies": {},
"devDependencies": {
View
65 setup.js
@@ -1,65 +0,0 @@
-var exec = require('child_process').exec;
-var sysPath = require('path');
-var fs = require('fs');
-
-// Cross-platform node.js postinstall & test script for coffeescript projects.
-
-var mode = process.argv[2];
-
-var fsExists = fs.exists || sysPath.exists;
-
-var getBinaryPath = function(binary) {
- return sysPath.join('node_modules', '.bin', binary);
-};
-
-var execute = function(path, params, callback) {
- if (callback == null) callback = function() {};
- var command = 'node ' + path + ' ' + params;
- console.log('Executing', command);
- exec(command, function(error, stdout, stderr) {
- if (error != null) return process.stderr.write(stderr.toString());
- console.log(stdout.toString());
- });
-};
-
-var togglePostinstall = function(add) {
- var pkg = require('./package.json');
-
- if (add) {
- if (!pkg.scripts) pkg.scripts = {};
- pkg.scripts.postinstall = 'node setup.js test';
- } else if (pkg.scripts && pkg.scripts.postinstall) {
- delete pkg.scripts.postinstall;
- }
-
- fs.writeFileSync('package.json', JSON.stringify(pkg, null, 2) + '\n');
-};
-
-switch (mode) {
- // Remove `.postinstall` script to prevent stupid npm bugs.
- case 'prepublish':
- togglePostinstall(false);
- execute(getBinaryPath('coffee'), '-o lib/ src/');
- break;
-
- // Bring back `.postinstall` script.
- case 'postpublish':
- togglePostinstall(true);
- break;
-
- // Compile coffeescript for git users.
- case 'postinstall':
- fsExists(sysPath.join(__dirname, 'lib'), function(exists) {
- if (exists) return;
- execute(getBinaryPath('coffee'), '-o lib/ src/');
- });
- break;
-
- // Run tests.
- case 'test':
- execute(
- getBinaryPath('mocha'),
- '--compilers coffee:coffee-script --require test/common.js --colors'
- );
- break;
-}

0 comments on commit 2a36a22

Please sign in to comment.