Skip to content

Commit e314c2b

Browse files
committed
Move ./lib/cli.js to ./bin/nodeunit
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
1 parent ca8f0ce commit e314c2b

File tree

5 files changed

+11
-9
lines changed

5 files changed

+11
-9
lines changed

Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ stamp-build: $(wildcard deps/* lib/*.js)
2424
printf "module.exports = require('$(PACKAGE)/nodeunit')" > $(BUILDDIR)/nodeunit.js
2525

2626
test:
27-
node ./lib/cli.js test
27+
./bin/nodeunit test
2828

2929
install: build
3030
install --directory $(NODEJSLIBDIR)
@@ -39,6 +39,6 @@ clean:
3939
rm -rf $(BUILDDIR) stamp-build
4040

4141
lint:
42-
nodelint --config nodelint.cfg ./index.js ./lib/*.js ./test/*.js
42+
nodelint --config nodelint.cfg ./index.js ./bin/nodeunit ./lib/*.js ./test/*.js
4343

4444
.PHONY: test install uninstall build all

lib/cli.js renamed to bin/nodeunit

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
var testrunner = require('./testrunner'),
1+
#!/usr/bin/env node
2+
3+
var testrunner = require('../lib/testrunner'),
24
fs = require('fs');
35

46
require.paths.push(process.cwd());
@@ -23,11 +25,11 @@ var options;
2325
if (args[0] === '--config' || args[0].slice(0, 9) === "--config=") {
2426
var config_file;
2527
if (args[0] === '--config') {
26-
config_file = args[1];
27-
args = args.slice(2);
28+
config_file = args[1];
29+
args = args.slice(2);
2830
} else {
29-
config_file = args[0].slice(9);
30-
args = args.slice(1);
31+
config_file = args[0].slice(9);
32+
args = args.slice(1);
3133
}
3234

3335
eval(fs.readFileSync(config_file, 'utf8'));
File renamed without changes.

lib/testrunner.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ var nodeunit = require('./nodeunit'),
1717
* Default options
1818
*/
1919

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

2323
/**

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,5 @@
1313
, "url" : "http://github.com/caolan/nodeunit/raw/master/LICENSE"
1414
}
1515
]
16-
, "bin" : { "nodeunit" : "./lib/cli.js" }
16+
, "bin" : { "nodeunit" : "./bin/nodeunit" }
1717
}

0 commit comments

Comments
 (0)