Skip to content

Commit 6dd4ee6

Browse files
committed
CYGWIN_ROOT_BIN
Signed-off-by: Sora Morimoto <[email protected]>
1 parent f11536f commit 6dd4ee6

File tree

4 files changed

+17
-6
lines changed

4 files changed

+17
-6
lines changed

dist/index.js

Lines changed: 7 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/post/index.js

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/setup-ocaml/src/constants.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,8 @@ export const CYGWIN_MIRROR = "https://cygwin.mirror.constant.com/";
5252
// [HACK] https://github.com/ocaml/setup-ocaml/pull/55
5353
export const CYGWIN_ROOT = path.join("D:", "cygwin");
5454

55+
export const CYGWIN_ROOT_BIN = path.join(CYGWIN_ROOT, "bin");
56+
5557
export const DUNE_CACHE_ROOT = (() => {
5658
const homeDir = os.homedir();
5759
if (PLATFORM === "windows") {

packages/setup-ocaml/src/installer.ts

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import {
99
saveOpamCache,
1010
} from "./cache.js";
1111
import {
12+
CYGWIN_ROOT_BIN,
1213
DUNE_CACHE,
1314
DUNE_CACHE_ROOT,
1415
OCAML_COMPILER,
@@ -62,9 +63,12 @@ export async function installer() {
6263
);
6364
}
6465
const { opamCacheHit, cygwinCacheHit } = await restoreOpamCaches();
65-
if (!cygwinCacheHit && PLATFORM === "windows") {
66-
await setupCygwin();
67-
await saveCygwinCache();
66+
if (PLATFORM === "windows") {
67+
if (!cygwinCacheHit) {
68+
await setupCygwin();
69+
await saveCygwinCache();
70+
}
71+
core.addPath(CYGWIN_ROOT_BIN);
6872
}
6973
await setupOpam();
7074
await repositoryRemoveAll();

0 commit comments

Comments
 (0)