mirror of
https://github.com/actions/setup-python.git
synced 2026-01-20 04:38:56 +08:00
resolved comments, update readme, add e2e tests.
This commit is contained in:
parent
739154f76b
commit
3d613a97df
7 changed files with 180 additions and 38 deletions
|
|
@ -1,5 +1,6 @@
|
|||
import * as fs from 'fs';
|
||||
import * as path from 'path';
|
||||
import * as semver from 'semver';
|
||||
|
||||
export const IS_WINDOWS = process.platform === 'win32';
|
||||
export const IS_LINUX = process.platform === 'linux';
|
||||
|
|
@ -40,3 +41,11 @@ export function createSymlinkInFolder(
|
|||
fs.chmodSync(targetPath, '755');
|
||||
}
|
||||
}
|
||||
|
||||
export function validateVersion(version: string) {
|
||||
return isNightlyKeyword(version) || Boolean(semver.validRange(version));
|
||||
}
|
||||
|
||||
export function isNightlyKeyword(pypyVersion: string) {
|
||||
return pypyVersion === 'nightly';
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue