mirror of
https://code.forgejo.org/actions/setup-python
synced 2025-06-09 04:42:20 +02:00
Optimize code
This commit is contained in:
parent
ccb7da8ae9
commit
099ed898be
2 changed files with 8 additions and 13 deletions
|
@ -39,14 +39,11 @@ function resolveVersionInput(): string {
|
|||
if (versionFile) {
|
||||
if (!fs.existsSync(versionFile)) {
|
||||
logWarning(
|
||||
`The specified python version file at: ${versionFile} does not exist. Attempting to find .python-version file.`
|
||||
`The specified python version file at: ${versionFile} doesn't exist. Attempting to find .python-version file.`
|
||||
);
|
||||
if (!fs.existsSync('.python-version')) {
|
||||
throw new Error(
|
||||
`The specified python version file at: ${versionFile} does not exist and default .python-version file isn't found.`
|
||||
);
|
||||
} else {
|
||||
versionFile = '.python-version';
|
||||
versionFile = '.python-version';
|
||||
if (!fs.existsSync(versionFile)) {
|
||||
throw new Error(`The ${versionFile} doesn't exist.`);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue