Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Detect old sbt version; plus some maintenance #18

Merged
merged 3 commits into from
Nov 8, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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