Skip to content

Commit

Permalink
Merge pull request #908 from ocaml/fix-dune-cache-root-win
Browse files Browse the repository at this point in the history
Fix DUNE_CACHE_ROOT on Windows
  • Loading branch information
smorimoto authored Dec 5, 2024
2 parents 9c8cce0 + a20edc7 commit 2760130
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 18 deletions.
10 changes: 4 additions & 6 deletions dist/index.js

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

10 changes: 4 additions & 6 deletions dist/post/index.js

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

10 changes: 4 additions & 6 deletions packages/setup-ocaml/src/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,15 +62,13 @@ export const CYGWIN_ROOT_BIN = path.join(CYGWIN_ROOT, "bin");

export const DUNE_CACHE_ROOT = (() => {
const homeDir = os.homedir();
if (PLATFORM === "windows") {
// [HACK] https://github.com/ocaml/setup-ocaml/pull/55
const duneCacheDir = path.join("D:", "dune");
return duneCacheDir;
}
const xdgCacheHome = process.env.XDG_CACHE_HOME;
const duneCacheDir = xdgCacheHome
? path.join(xdgCacheHome, "dune")
: path.join(homeDir, ".cache", "dune");
: PLATFORM === "windows"
? // [HACK] https://github.com/ocaml/setup-ocaml/pull/55
path.join("D:", "dune")
: path.join(homeDir, ".cache", "dune");
return duneCacheDir;
})();

Expand Down

0 comments on commit 2760130

Please sign in to comment.