Skip to content
This repository was archived by the owner on Jan 25, 2024. It is now read-only.

Commit eb0ad7a

Browse files
committed
fix(cli): exit gracefully
1 parent 887af72 commit eb0ad7a

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

src/cli.ts

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,10 @@ const compile = async (
226226

227227
const sourceMapFile = options.sourceMapFile;
228228
options.inputPath = inputPath.mountedFullPath;
229-
const fileContext = context.file.create(inputPath.mountedFullPath);
229+
230+
//TODO: do we need to supply mountedpath instead?
231+
//(sass-spec fails on some test with mounted path, cause output expects physical path instead)
232+
const fileContext = context.file.create(inputPath.raw);
230233
const sassContext = fileContext.getContext();
231234
fileContext.options = options;
232235
fileContext.compile();
@@ -252,7 +255,7 @@ const main = async (argv: Array<string> = process.argv) => {
252255
const usageDefinition = displayHelp ? helpDefinitions : await buildDisplayVersion();
253256
const usage = cmdUsage([...usageDefinition]);
254257
console.log(usage);
255-
return;
258+
return 0;
256259
}
257260

258261
const { loadModule } = await import('./loadModule');
@@ -290,12 +293,12 @@ const main = async (argv: Array<string> = process.argv) => {
290293
.map(({ mountedDir }) => mountedDir)
291294
.forEach(dir => interop.unmount(dir));
292295

293-
process.exit(result);
296+
return result;
294297
};
295298

296299
(async () => {
297300
try {
298-
await main();
301+
process.exitCode = await main();
299302
} catch (error) {
300303
console.log(error);
301304
process.exit(-1);

0 commit comments

Comments
 (0)