Skip to content

Commit

Permalink
Move ./lib/cli.js to ./bin/nodeunit
Browse files Browse the repository at this point in the history
I don't change stamp-build target in Makefile
Mauby best way is to copy all files into /usr/locl/lib/nodeunit
and make symlink in /usr/local/bin
  • Loading branch information
Sannis committed Sep 29, 2010
1 parent ca8f0ce commit e314c2b
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 9 deletions.
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ stamp-build: $(wildcard deps/* lib/*.js)
printf "module.exports = require('$(PACKAGE)/nodeunit')" > $(BUILDDIR)/nodeunit.js

test:
node ./lib/cli.js test
./bin/nodeunit test

install: build
install --directory $(NODEJSLIBDIR)
Expand All @@ -39,6 +39,6 @@ clean:
rm -rf $(BUILDDIR) stamp-build

lint:
nodelint --config nodelint.cfg ./index.js ./lib/*.js ./test/*.js
nodelint --config nodelint.cfg ./index.js ./bin/nodeunit ./lib/*.js ./test/*.js

.PHONY: test install uninstall build all
12 changes: 7 additions & 5 deletions lib/cli.js → bin/nodeunit
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
var testrunner = require('./testrunner'),
#!/usr/bin/env node

var testrunner = require('../lib/testrunner'),
fs = require('fs');

require.paths.push(process.cwd());
Expand All @@ -23,11 +25,11 @@ var options;
if (args[0] === '--config' || args[0].slice(0, 9) === "--config=") {
var config_file;
if (args[0] === '--config') {
config_file = args[1];
args = args.slice(2);
config_file = args[1];
args = args.slice(2);
} else {
config_file = args[0].slice(9);
args = args.slice(1);
config_file = args[0].slice(9);
args = args.slice(1);
}

eval(fs.readFileSync(config_file, 'utf8'));
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion lib/testrunner.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ var nodeunit = require('./nodeunit'),
* Default options
*/

eval(fs.readFileSync(__dirname + '/testrunner_default_options.js', 'utf8'));
eval(fs.readFileSync(__dirname + '/../bin/nodeunit.cfg', 'utf8'));
var default_options = options;

/**
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,5 @@
, "url" : "http://github.com/caolan/nodeunit/raw/master/LICENSE"
}
]
, "bin" : { "nodeunit" : "./lib/cli.js" }
, "bin" : { "nodeunit" : "./bin/nodeunit" }
}

0 comments on commit e314c2b

Please sign in to comment.