mirror of
https://github.com/actions/setup-python.git
synced 2025-06-28 05:33:47 +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,15 +96947,15 @@ function cacheDependencies(cache, pythonVersion) {
|
||||||
// Copy file asynchronously
|
// Copy file asynchronously
|
||||||
yield fs_1.default.promises.copyFile(sourcePath, targetPath);
|
yield fs_1.default.promises.copyFile(sourcePath, targetPath);
|
||||||
core.info(`Copied ${sourcePath} to ${targetPath}`);
|
core.info(`Copied ${sourcePath} to ${targetPath}`);
|
||||||
}
|
|
||||||
else {
|
|
||||||
core.info(`Dependency file is already inside the workspace: ${sourcePath}`);
|
|
||||||
}
|
|
||||||
resolvedDependencyPath = path
|
resolvedDependencyPath = path
|
||||||
.relative(workspace, targetPath)
|
.relative(workspace, targetPath)
|
||||||
.replace(/\\/g, '/');
|
.replace(/\\/g, '/');
|
||||||
core.info(`Resolved cache-dependency-path: ${resolvedDependencyPath}`);
|
core.info(`Resolved cache-dependency-path: ${resolvedDependencyPath}`);
|
||||||
}
|
}
|
||||||
|
else {
|
||||||
|
core.info(`Dependency file is already inside the workspace: ${sourcePath}`);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
catch (error) {
|
catch (error) {
|
||||||
core.warning(`Failed to copy file from ${sourcePath} to ${targetPath}: ${error}`);
|
core.warning(`Failed to copy file from ${sourcePath} to ${targetPath}: ${error}`);
|
||||||
|
|
|
@ -53,16 +53,18 @@ export async function cacheDependencies(cache: string, pythonVersion: string) {
|
||||||
// Copy file asynchronously
|
// Copy file asynchronously
|
||||||
await fs.promises.copyFile(sourcePath, targetPath);
|
await fs.promises.copyFile(sourcePath, targetPath);
|
||||||
core.info(`Copied ${sourcePath} to ${targetPath}`);
|
core.info(`Copied ${sourcePath} to ${targetPath}`);
|
||||||
|
|
||||||
|
resolvedDependencyPath = path
|
||||||
|
.relative(workspace, targetPath)
|
||||||
|
.replace(/\\/g, '/');
|
||||||
|
core.info(
|
||||||
|
`Resolved cache-dependency-path: ${resolvedDependencyPath}`
|
||||||
|
);
|
||||||
} else {
|
} else {
|
||||||
core.info(
|
core.info(
|
||||||
`Dependency file is already inside the workspace: ${sourcePath}`
|
`Dependency file is already inside the workspace: ${sourcePath}`
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
resolvedDependencyPath = path
|
|
||||||
.relative(workspace, targetPath)
|
|
||||||
.replace(/\\/g, '/');
|
|
||||||
core.info(`Resolved cache-dependency-path: ${resolvedDependencyPath}`);
|
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
core.warning(
|
core.warning(
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue