refactored the code

This commit is contained in:
Aparna Jyothi 2025-06-19 13:17:10 +05:30
parent e0348c889a
commit 6d7172dabe
2 changed files with 11 additions and 9 deletions

8
dist/setup/index.js vendored
View file

@ -96947,14 +96947,14 @@ function cacheDependencies(cache, pythonVersion) {
// Copy file asynchronously
yield fs_1.default.promises.copyFile(sourcePath, targetPath);
core.info(`Copied ${sourcePath} to ${targetPath}`);
resolvedDependencyPath = path
.relative(workspace, targetPath)
.replace(/\\/g, '/');
core.info(`Resolved cache-dependency-path: ${resolvedDependencyPath}`);
}
else {
core.info(`Dependency file is already inside the workspace: ${sourcePath}`);
}
resolvedDependencyPath = path
.relative(workspace, targetPath)
.replace(/\\/g, '/');
core.info(`Resolved cache-dependency-path: ${resolvedDependencyPath}`);
}
}
catch (error) {

View file

@ -53,16 +53,18 @@ export async function cacheDependencies(cache: string, pythonVersion: string) {
// Copy file asynchronously
await fs.promises.copyFile(sourcePath, targetPath);
core.info(`Copied ${sourcePath} to ${targetPath}`);
resolvedDependencyPath = path
.relative(workspace, targetPath)
.replace(/\\/g, '/');
core.info(
`Resolved cache-dependency-path: ${resolvedDependencyPath}`
);
} else {
core.info(
`Dependency file is already inside the workspace: ${sourcePath}`
);
}
resolvedDependencyPath = path
.relative(workspace, targetPath)
.replace(/\\/g, '/');
core.info(`Resolved cache-dependency-path: ${resolvedDependencyPath}`);
}
} catch (error) {
core.warning(