mirror of
https://github.com/actions/setup-python.git
synced 2025-06-27 21:23:48 +00:00
refactored the code
This commit is contained in:
parent
e0348c889a
commit
6d7172dabe
2 changed files with 11 additions and 9 deletions
8
dist/setup/index.js
vendored
8
dist/setup/index.js
vendored
|
@ -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) {
|
||||
|
|
|
@ -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(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue