Merge pull request #4347 from tschaub/find-jsdoc
Use require.resolve() to find jsdoc.
This commit is contained in:
@@ -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 : []);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user