Skip to content

Commit e979475

Browse files
committed
fix: handle relative paths more better
1 parent 2859650 commit e979475

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

packages/SwingSet/src/controller.js

+3-4
Original file line numberDiff line numberDiff line change
@@ -138,14 +138,13 @@ export function loadBasedir(basedir) {
138138
*/
139139
function resolveSpecFromConfig(dirname, specPath) {
140140
try {
141-
return require.resolve(specPath);
141+
return require.resolve(specPath, { path: [dirname] });
142142
} catch (e) {
143-
if (e.code === 'MODULE_NOT_FOUND') {
144-
return path.resolve(dirname, specPath);
145-
} else {
143+
if (e.code !== 'MODULE_NOT_FOUND') {
146144
throw e;
147145
}
148146
}
147+
return path.resolve(dirname, specPath);
149148
}
150149

151150
/**

0 commit comments

Comments
 (0)