Skip to content
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
13 changes: 4 additions & 9 deletions lib/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 7 additions & 9 deletions src/installer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@ function getOpamDownloadUrl(version: string, filename: string) {

async function acquireOpamWindows(version: string, customRepository: string) {
const repository =
customRepository === ""
? "https://github.com/fdopen/opam-repository-mingw.git#opam2"
: customRepository;
customRepository ||
"https://github.com/fdopen/opam-repository-mingw.git#opam2";

let downloadPath;
try {
downloadPath = await tc.downloadTool("https://cygwin.com/setup-x86_64.exe");
Expand Down Expand Up @@ -57,9 +57,8 @@ async function acquireOpamLinux(version: string, customRepository: string) {
const fileName = getOpamFileName(opamVersion);
const downloadUrl = getOpamDownloadUrl(opamVersion, fileName);
const repository =
customRepository === ""
? "https://github.com/ocaml/opam-repository.git"
: customRepository;
customRepository || "https://github.com/ocaml/opam-repository.git";

let downloadPath;
try {
downloadPath = await tc.downloadTool(downloadUrl);
Expand All @@ -85,9 +84,8 @@ async function acquireOpamLinux(version: string, customRepository: string) {

async function acquireOpamDarwin(version: string, customRepository: string) {
const repository =
customRepository === ""
? "https://github.com/ocaml/opam-repository.git"
: customRepository;
customRepository || "https://github.com/ocaml/opam-repository.git";

await exec("brew", ["install", "opam"]);
await exec("opam", ["init", "-yav", repository]);
await exec(path.join(__dirname, "install-ocaml-unix.sh"), [version]);
Expand Down