Skip to content
This repository has been archived by the owner on Mar 21, 2023. It is now read-only.

Commit

Permalink
Merge pull request #164 from tgodzik/fix-utf
Browse files Browse the repository at this point in the history
Add utf-8 to the process fetching Metals and fix downloading jabba
  • Loading branch information
gabro authored Aug 14, 2020
2 parents f1d6a07 + ef47dbd commit aee6828
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
1 change: 1 addition & 0 deletions src/fetchMetals.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ export function fetchMetals({
[
...javaOptions,
...fetchProperties,
"-Dfile.encoding=UTF-8",
"-jar",
coursierPath,
"fetch",
Expand Down
17 changes: 11 additions & 6 deletions src/installJava.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,14 @@ export function installJava({
const jabbaPath = path.join(bin, jabbaBinaryName());

return mkdirp(bin)
.catch((err: Error) => {
console.debug(err);
outputChannel.appendLine(err.message);
})
.then(() =>
download({ url: jabbaUrl, outputPath: jabbaPath, makeExecutable: true })
download({
url: jabbaUrl,
outputPath: jabbaPath,
makeExecutable: true,
})
)
.then(() => pcp.exec(`${jabbaPath} ls-remote`))
.then(() => pcp.exec(`"${jabbaPath}" ls-remote`))
.then((out) =>
outputToString(out.stdout)
.split("\n")
Expand All @@ -54,6 +54,11 @@ export function installJava({
.then(() => outputChannel.appendLine(`${java} installed`))
.then(() => pcp.exec(`${jabbaPath} which --home ${java}`))
.then((e: pcp.Output) => outputToString(e.stdout).trim());
})
.catch((err: Error) => {
console.debug(err);
outputChannel.appendLine(err.message);
throw err;
});
}

Expand Down

0 comments on commit aee6828

Please sign in to comment.