fixup bin/carto as require.resolve throws rather than returning false
This commit is contained in:
parent
1437dfba60
commit
e62d4ea877
11
bin/carto
11
bin/carto
@ -63,11 +63,18 @@ try {
|
||||
process.exit(1);
|
||||
}
|
||||
|
||||
if (!require.resolve('millstone')) {
|
||||
var millstone = null;
|
||||
|
||||
try {
|
||||
require.resolve('millstone');
|
||||
} catch (err) {
|
||||
var millstone = require('millstone');
|
||||
}
|
||||
|
||||
if (!millstone) {
|
||||
console.warn('carto: Millstone not found. Externals will not be resolved.');
|
||||
return compile(null, data);
|
||||
} else {
|
||||
var millstone = require('millstone');
|
||||
millstone.resolve({
|
||||
mml: data,
|
||||
base: path.dirname(input),
|
||||
|
Loading…
Reference in New Issue
Block a user