From a6b01c4e407b1f7787010fb1e61a07c065555209 Mon Sep 17 00:00:00 2001 From: IvanZosimov Date: Thu, 30 Jun 2022 16:22:51 +0200 Subject: [PATCH] Rebuild action with new changes --- dist/setup/index.js | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/dist/setup/index.js b/dist/setup/index.js index 2b48b60..5ab9c89 100644 --- a/dist/setup/index.js +++ b/dist/setup/index.js @@ -65270,19 +65270,19 @@ function resolveVersionInput() { } if (versionFile) { const defaultVersionFile = '.python-version'; - const VersionFileExists = fs_1.default.existsSync(versionFile); - const defaultVersionFileExists = fs_1.default.existsSync(defaultVersionFile); - if (!VersionFileExists && !defaultVersionFileExists) { - throw new Error(`The specified python version file at: ${versionFile} does not exist and default ${defaultVersionFile} file isn't found`); - } - if (VersionFileExists) { - version = fs_1.default.readFileSync(versionFile, 'utf8'); - core.info(`Resolved ${versionFile} as ${version}`); - } - else { - version = fs_1.default.readFileSync(defaultVersionFile, 'utf8'); - core.info(`Resolved ${defaultVersionFile} as ${version}`); + if (!fs_1.default.existsSync(versionFile)) { + if (versionFile === defaultVersionFile) { + throw new Error(`The specified python version file at: ${versionFile} does not exist.`); + } + if (fs_1.default.existsSync(defaultVersionFile)) { + versionFile = defaultVersionFile; + } + else { + throw new Error(`The specified python version file at: ${versionFile} does not exist and default ${defaultVersionFile} file isn't found`); + } } + version = fs_1.default.readFileSync(versionFile, 'utf8'); + core.info(`Resolved ${versionFile} as ${version}`); return version; } core.warning("Neither 'python-version' nor 'python-version-file' inputs were supplied. ");