fixup bin/carto as require.resolve throws rather than returning false

This commit is contained in:
Dane Springmeyer 2011-08-05 12:18:29 -07:00
parent 1437dfba60
commit e62d4ea877

View File

@ -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),