mirror of
https://github.com/jsdoc/jsdoc.git
synced 2025-12-08 19:46:11 +00:00
support global installation with 'npm install -g' (#374)
This commit is contained in:
parent
32b2ea5a1d
commit
35cfc7c595
@ -28,6 +28,7 @@
|
||||
"underscore": "1.4.2",
|
||||
"wrench": "1.3.9"
|
||||
},
|
||||
"bin": "./nodejs/bin/jsdoc",
|
||||
"bugs": "https://github.com/jsdoc3/jsdoc/issues",
|
||||
"author": {
|
||||
"name": "Michael Mathews",
|
||||
|
||||
26
nodejs/bin/jsdoc
Executable file
26
nodejs/bin/jsdoc
Executable file
@ -0,0 +1,26 @@
|
||||
#!/usr/bin/env node
|
||||
|
||||
// This wrapper script allows JSDoc to be installed with 'npm install -g'.
|
||||
// Note that JSDoc will still run on Mozilla Rhino, NOT Node.js.
|
||||
|
||||
|
||||
var fs = require('fs');
|
||||
var os = require('os');
|
||||
var path = require('path');
|
||||
var spawnProc = require('child_process').spawn;
|
||||
|
||||
var args = process.argv.slice(2);
|
||||
var script = path.normalize( path.join( path.dirname(fs.realpathSync(process.argv[1])), '..', '..',
|
||||
'jsdoc' ) );
|
||||
var jsdoc;
|
||||
|
||||
if (process.platform === 'win32') {
|
||||
jsdoc = spawnProc(script + '.cmd', args, {stdio: 'inherit'});
|
||||
}
|
||||
else {
|
||||
jsdoc = spawnProc(script, args, {stdio: 'inherit'});
|
||||
}
|
||||
|
||||
jsdoc.on('close', function(code) {
|
||||
process.exit(code);
|
||||
});
|
||||
@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "jsdoc",
|
||||
"version": "3.2.0-dev",
|
||||
"revision": "1365776112567",
|
||||
"revision": "1366126973987",
|
||||
"description": "An API documentation generator for JavaScript.",
|
||||
"keywords": [ "documentation", "javascript" ],
|
||||
"licenses": [
|
||||
@ -28,6 +28,7 @@
|
||||
"underscore": "1.4.2",
|
||||
"wrench": "1.3.9"
|
||||
},
|
||||
"bin": "./nodejs/bin/jsdoc",
|
||||
"bugs": "https://github.com/jsdoc3/jsdoc/issues",
|
||||
"author": {
|
||||
"name": "Michael Mathews",
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user