Skip to content

Commit c5ac901

Browse files
authoredNov 8, 2023
Merge pull request #18 from raquo/main
Detect old sbt version; plus some maintenance
2 parents 2f94cf3 + ad5fbe3 commit c5ac901

File tree

3 files changed

+261
-331
lines changed

3 files changed

+261
-331
lines changed
 

‎.gitignore

+9
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,12 @@
11
/node_modules/
22
/dist/
33
target/
4+
5+
.bloop/
6+
.bsp/
7+
.idea/
8+
.metals/
9+
.vscode/
10+
metals.sbt
11+
12+
.DS_Store

‎index.ts

+9-3
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,16 @@ function printSbtTask(task: string, cwd?: string): Promise<string> {
2525
reject(new Error(`sbt invocation for Scala.js compilation could not start. Is it installed?\n${err}`));
2626
});
2727
child.on('close', code => {
28-
if (code !== 0)
29-
reject(new Error(`sbt invocation for Scala.js compilation failed with exit code ${code}.`));
30-
else
28+
if (code !== 0) {
29+
let errorMessage = `sbt invocation for Scala.js compilation failed with exit code ${code}.`;
30+
if (fullOutput.includes("Not a valid command: --")) {
31+
errorMessage += "\nCause: Your sbt launcher script version is too old (<1.3.3)."
32+
errorMessage += "\nFix: Re-install the latest version of sbt launcher script from https://www.scala-sbt.org/"
33+
}
34+
reject(new Error(errorMessage));
35+
} else {
3136
resolve(fullOutput.trimEnd().split('\n').at(-1)!);
37+
}
3238
});
3339
});
3440
}

0 commit comments

Comments
 (0)