Skip to content

Commit

Permalink
CYGWIN_ROOT_BIN
Browse files Browse the repository at this point in the history
Signed-off-by: Sora Morimoto <[email protected]>
  • Loading branch information
smorimoto committed Jun 14, 2024
1 parent f11536f commit 6dd4ee6
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 6 deletions.
10 changes: 7 additions & 3 deletions dist/index.js

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

1 change: 1 addition & 0 deletions dist/post/index.js

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

2 changes: 2 additions & 0 deletions packages/setup-ocaml/src/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@ export const CYGWIN_MIRROR = "https://cygwin.mirror.constant.com/";
// [HACK] https://github.com/ocaml/setup-ocaml/pull/55
export const CYGWIN_ROOT = path.join("D:", "cygwin");

export const CYGWIN_ROOT_BIN = path.join(CYGWIN_ROOT, "bin");

export const DUNE_CACHE_ROOT = (() => {
const homeDir = os.homedir();
if (PLATFORM === "windows") {
Expand Down
10 changes: 7 additions & 3 deletions packages/setup-ocaml/src/installer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import {
saveOpamCache,
} from "./cache.js";
import {
CYGWIN_ROOT_BIN,
DUNE_CACHE,
DUNE_CACHE_ROOT,
OCAML_COMPILER,
Expand Down Expand Up @@ -62,9 +63,12 @@ export async function installer() {
);
}
const { opamCacheHit, cygwinCacheHit } = await restoreOpamCaches();
if (!cygwinCacheHit && PLATFORM === "windows") {
await setupCygwin();
await saveCygwinCache();
if (PLATFORM === "windows") {
if (!cygwinCacheHit) {
await setupCygwin();
await saveCygwinCache();
}
core.addPath(CYGWIN_ROOT_BIN);
}
await setupOpam();
await repositoryRemoveAll();
Expand Down

0 comments on commit 6dd4ee6

Please sign in to comment.