mirror of
https://github.com/actions/setup-python.git
synced 2025-06-27 21:23:48 +00:00
updated logic
This commit is contained in:
parent
742e424099
commit
08ee4fc403
2 changed files with 17 additions and 13 deletions
14
dist/setup/index.js
vendored
14
dist/setup/index.js
vendored
|
@ -96934,12 +96934,14 @@ function cacheDependencies(cache, pythonVersion) {
|
||||||
core.warning(`The resolved cache-dependency-path does not exist: ${sourcePath}`);
|
core.warning(`The resolved cache-dependency-path does not exist: ${sourcePath}`);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
try {
|
if (sourcePath !== targetPath) {
|
||||||
fs_1.default.copyFileSync(sourcePath, targetPath);
|
try {
|
||||||
core.info(`Copied ${sourcePath} to ${targetPath}`);
|
fs_1.default.copyFileSync(sourcePath, targetPath);
|
||||||
}
|
core.info(`Copied ${sourcePath} to ${targetPath}`);
|
||||||
catch (error) {
|
}
|
||||||
core.warning(`Failed to copy file from ${sourcePath} to ${targetPath}: ${error}`);
|
catch (error) {
|
||||||
|
core.warning(`Failed to copy file from ${sourcePath} to ${targetPath}: ${error}`);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
resolvedDependencyPath = path.relative(workspace, targetPath);
|
resolvedDependencyPath = path.relative(workspace, targetPath);
|
||||||
|
|
|
@ -42,13 +42,15 @@ export async function cacheDependencies(cache: string, pythonVersion: string) {
|
||||||
`The resolved cache-dependency-path does not exist: ${sourcePath}`
|
`The resolved cache-dependency-path does not exist: ${sourcePath}`
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
try {
|
if (sourcePath !== targetPath) {
|
||||||
fs.copyFileSync(sourcePath, targetPath);
|
try {
|
||||||
core.info(`Copied ${sourcePath} to ${targetPath}`);
|
fs.copyFileSync(sourcePath, targetPath);
|
||||||
} catch (error) {
|
core.info(`Copied ${sourcePath} to ${targetPath}`);
|
||||||
core.warning(
|
} catch (error) {
|
||||||
`Failed to copy file from ${sourcePath} to ${targetPath}: ${error}`
|
core.warning(
|
||||||
);
|
`Failed to copy file from ${sourcePath} to ${targetPath}: ${error}`
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue