Skip to content

Commit

Permalink
Merge pull request #18 from raquo/main
Browse files Browse the repository at this point in the history
Detect old sbt version; plus some maintenance
  • Loading branch information
sjrd authored Nov 8, 2023
2 parents 2f94cf3 + ad5fbe3 commit c5ac901
Show file tree
Hide file tree
Showing 3 changed files with 261 additions and 331 deletions.
9 changes: 9 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
/node_modules/
/dist/
target/

.bloop/
.bsp/
.idea/
.metals/
.vscode/
metals.sbt

.DS_Store
12 changes: 9 additions & 3 deletions index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,16 @@ function printSbtTask(task: string, cwd?: string): Promise<string> {
reject(new Error(`sbt invocation for Scala.js compilation could not start. Is it installed?\n${err}`));
});
child.on('close', code => {
if (code !== 0)
reject(new Error(`sbt invocation for Scala.js compilation failed with exit code ${code}.`));
else
if (code !== 0) {
let errorMessage = `sbt invocation for Scala.js compilation failed with exit code ${code}.`;
if (fullOutput.includes("Not a valid command: --")) {
errorMessage += "\nCause: Your sbt launcher script version is too old (<1.3.3)."
errorMessage += "\nFix: Re-install the latest version of sbt launcher script from https://www.scala-sbt.org/"
}
reject(new Error(errorMessage));
} else {
resolve(fullOutput.trimEnd().split('\n').at(-1)!);
}
});
});
}
Expand Down
Loading

0 comments on commit c5ac901

Please sign in to comment.