Merge pull request #4347 from tschaub/find-jsdoc

Use require.resolve() to find jsdoc.
This commit is contained in:
Tim Schaub
2015-10-31 13:26:58 -06:00
+6 -4
View File
@@ -14,11 +14,13 @@ var externsPaths = [
path.join(externsDir, 'geojson.js') path.join(externsDir, 'geojson.js')
]; ];
var infoPath = path.join(__dirname, '..', 'build', 'info.json'); var infoPath = path.join(__dirname, '..', 'build', 'info.json');
var jsdoc = path.join(__dirname, '..', 'node_modules', '.bin', 'jsdoc');
var jsdocResolved = require.resolve('jsdoc/jsdoc.js');
var jsdoc = path.resolve(path.dirname(jsdocResolved), '../.bin/jsdoc');
// on Windows, use jsdoc.cmd // on Windows, use jsdoc.cmd
if (isWindows) { if (isWindows) {
jsdoc += '.cmd'; jsdoc += '.cmd';
} }
var jsdocConfig = path.join( var jsdocConfig = path.join(
@@ -99,7 +101,7 @@ function getNewer(date, newer, callback) {
callback(new Error('Trouble walking ' + sourceDir)); callback(new Error('Trouble walking ' + sourceDir));
}); });
walker.on('end', function() { walker.on('end', function() {
/** /**
* Windows has restrictions on length of command line, so passing all the * Windows has restrictions on length of command line, so passing all the
* changed paths to a task will fail if this limit is exceeded. * changed paths to a task will fail if this limit is exceeded.
@@ -109,7 +111,7 @@ function getNewer(date, newer, callback) {
if (isWindows) { if (isWindows) {
paths = [sourceDir].concat(externsPaths); paths = [sourceDir].concat(externsPaths);
} }
callback(null, newer ? paths : []); callback(null, newer ? paths : []);
}); });
} }