( folderPath: string, sourceName: string, targetName: string, setExecutable = false )
| 47 | * toolcache versions have this setup. |
| 48 | */ |
| 49 | export 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 | |
| 67 | export function validateVersion(version: string) { |
| 68 | return isNightlyKeyword(version) || Boolean(semver.validRange(version)); |
no outgoing calls
no test coverage detected