updated logic

This commit is contained in:
Aparna Jyothi 2025-06-09 12:56:17 +05:30
parent 742e424099
commit 08ee4fc403
2 changed files with 17 additions and 13 deletions

View file

@ -42,13 +42,15 @@ export async function cacheDependencies(cache: string, pythonVersion: string) {
`The resolved cache-dependency-path does not exist: ${sourcePath}`
);
} else {
try {
fs.copyFileSync(sourcePath, targetPath);
core.info(`Copied ${sourcePath} to ${targetPath}`);
} catch (error) {
core.warning(
`Failed to copy file from ${sourcePath} to ${targetPath}: ${error}`
);
if (sourcePath !== targetPath) {
try {
fs.copyFileSync(sourcePath, targetPath);
core.info(`Copied ${sourcePath} to ${targetPath}`);
} catch (error) {
core.warning(
`Failed to copy file from ${sourcePath} to ${targetPath}: ${error}`
);
}
}
}