Skip to content

Commit

Permalink
fix: sync .complete marker when caching tools on windows
Browse files Browse the repository at this point in the history
  • Loading branch information
galargh committed Aug 12, 2023
1 parent aabcd82 commit 89a192a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
4 changes: 4 additions & 0 deletions dist/setup/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -61514,6 +61514,10 @@ function cacheWindowsDir(extPath, tool, version, arch) {
fs_1.default.mkdirSync(path.dirname(defaultToolCacheDir), { recursive: true });
fs_1.default.symlinkSync(actualToolCacheDir, defaultToolCacheDir, 'junction');
core.info(`Created link ${defaultToolCacheDir} => ${actualToolCacheDir}`);
const actualToolCacheCompleteFile = `${actualToolCacheDir}.complete`;
const defaultToolCacheCompleteFile = `${defaultToolCacheDir}.complete`;
fs_1.default.symlinkSync(actualToolCacheCompleteFile, defaultToolCacheCompleteFile, 'file');
core.info(`Created link ${defaultToolCacheCompleteFile} => ${actualToolCacheCompleteFile}`);
// make outer code to continue using toolcache as if it were installed on c:
// restore toolcache root to default drive c:
process.env['RUNNER_TOOL_CACHE'] = defaultToolCacheRoot;
Expand Down
5 changes: 5 additions & 0 deletions src/installer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,11 @@ async function cacheWindowsDir(
fs.symlinkSync(actualToolCacheDir, defaultToolCacheDir, 'junction');
core.info(`Created link ${defaultToolCacheDir} => ${actualToolCacheDir}`);

const actualToolCacheCompleteFile = `${actualToolCacheDir}.complete`;
const defaultToolCacheCompleteFile = `${defaultToolCacheDir}.complete`;
fs.symlinkSync(actualToolCacheCompleteFile, defaultToolCacheCompleteFile, 'file');
core.info(`Created link ${defaultToolCacheCompleteFile} => ${actualToolCacheCompleteFile}`);

// make outer code to continue using toolcache as if it were installed on c:
// restore toolcache root to default drive c:
process.env['RUNNER_TOOL_CACHE'] = defaultToolCacheRoot;
Expand Down

0 comments on commit 89a192a

Please sign in to comment.