Skip to content

Commit 0466857

Browse files
committed
add workaround for npm-link'ed sane-topojson
1 parent afdf997 commit 0466857

File tree

1 file changed

+14
-3
lines changed

1 file changed

+14
-3
lines changed

tasks/util/constants.js

+14-3
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,20 @@ var pathToImageTest = path.join(pathToRoot, 'test/image');
88
var pathToDist = path.join(pathToRoot, 'dist/');
99
var pathToBuild = path.join(pathToRoot, 'build/');
1010

11-
var pathToTopojsonSrc = path.join(
12-
path.dirname(require.resolve('sane-topojson')), 'dist/'
13-
);
11+
var pathToTopojsonSrc;
12+
try {
13+
pathToTopojsonSrc = path.join(path.dirname(require.resolve('sane-topojson')), 'dist/');
14+
} catch(e) {
15+
console.log([
16+
'',
17+
'WARN: Cannot resolve path to *sane-topojson* package.',
18+
' This can happen when one `npm link sane-topojson`',
19+
' and runs a command in a Docker container.',
20+
' There is nothing to worry, if you see this warning while running',
21+
' `npm run test-image`, `npm run test-export` or `npm run baseline` ;)',
22+
''
23+
].join('\n'));
24+
}
1425

1526
var partialBundleNames = [
1627
'basic', 'cartesian', 'geo', 'gl3d', 'gl2d', 'mapbox', 'finance'

0 commit comments

Comments
 (0)