Rebuild action with new changes

This commit is contained in:
IvanZosimov 2022-06-30 16:22:51 +02:00
parent 84087f5301
commit a6b01c4e40

18
dist/setup/index.js vendored
View file

@ -65270,19 +65270,19 @@ function resolveVersionInput() {
} }
if (versionFile) { if (versionFile) {
const defaultVersionFile = '.python-version'; const defaultVersionFile = '.python-version';
const VersionFileExists = fs_1.default.existsSync(versionFile); if (!fs_1.default.existsSync(versionFile)) {
const defaultVersionFileExists = fs_1.default.existsSync(defaultVersionFile); if (versionFile === defaultVersionFile) {
if (!VersionFileExists && !defaultVersionFileExists) { throw new Error(`The specified python version file at: ${versionFile} does not exist.`);
throw new Error(`The specified python version file at: ${versionFile} does not exist and default ${defaultVersionFile} file isn't found`);
} }
if (VersionFileExists) { if (fs_1.default.existsSync(defaultVersionFile)) {
version = fs_1.default.readFileSync(versionFile, 'utf8'); versionFile = defaultVersionFile;
core.info(`Resolved ${versionFile} as ${version}`);
} }
else { else {
version = fs_1.default.readFileSync(defaultVersionFile, 'utf8'); throw new Error(`The specified python version file at: ${versionFile} does not exist and default ${defaultVersionFile} file isn't found`);
core.info(`Resolved ${defaultVersionFile} as ${version}`);
} }
}
version = fs_1.default.readFileSync(versionFile, 'utf8');
core.info(`Resolved ${versionFile} as ${version}`);
return version; return version;
} }
core.warning("Neither 'python-version' nor 'python-version-file' inputs were supplied. "); core.warning("Neither 'python-version' nor 'python-version-file' inputs were supplied. ");