MCPcopy Index your code
hub / github.com/actions/setup-python / createSymlinkInFolder

Function createSymlinkInFolder

src/utils.ts:49–65  ·  view source on GitHub ↗
(
  folderPath: string,
  sourceName: string,
  targetName: string,
  setExecutable = false
)

Source from the content-addressed store, hash-verified

47 * toolcache versions have this setup.
48 */
49export function createSymlinkInFolder(
50 folderPath: string,
51 sourceName: string,
52 targetName: string,
53 setExecutable = false
54) {
55 const sourcePath = path.join(folderPath, sourceName);
56 const targetPath = path.join(folderPath, targetName);
57 if (fs.existsSync(targetPath)) {
58 return;
59 }
60
61 fs.symlinkSync(sourcePath, targetPath);
62 if (!IS_WINDOWS && setExecutable) {
63 fs.chmodSync(targetPath, '755');
64 }
65}
66
67export function validateVersion(version: string) {
68 return isNightlyKeyword(version) || Boolean(semver.validRange(version));

Callers 2

createPyPySymlinkFunction · 0.90
createGraalPySymlinkFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected