@@ -65241,6 +65241,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
6524165241 return (mod && mod.__esModule) ? mod : { "default": mod };
6524265242};
6524365243Object.defineProperty(exports, "__esModule", ({ value: true }));
65244+ exports.logWarning = void 0;
6524465245const core = __importStar(__nccwpck_require__(2186));
6524565246const finder = __importStar(__nccwpck_require__(9996));
6524665247const finderPyPy = __importStar(__nccwpck_require__(4003));
@@ -65263,17 +65264,24 @@ function resolveVersionInput() {
6526365264 let version = core.getInput('python-version');
6526465265 let versionFile = core.getInput('python-version-file');
6526565266 if (version && versionFile) {
65266- core.warning('Both python-version and python-version-file inputs are specified, only python-version will be used');
65267+ core.warning('Both python-version and python-version-file inputs are specified, only python-version will be used. ');
6526765268 }
6526865269 if (version) {
6526965270 return version;
6527065271 }
65271- versionFile = versionFile || '.python-version';
65272- if (!fs_1.default.existsSync(versionFile)) {
65273- throw new Error(`The specified python version file at: ${versionFile} does not exist`);
65272+ if (versionFile) {
65273+ if (!fs_1.default.existsSync(versionFile)) {
65274+ logWarning(`The specified python version file at: ${versionFile} doesn't exist. Attempting to find .python-version file.`);
65275+ versionFile = '.python-version';
65276+ if (!fs_1.default.existsSync(versionFile)) {
65277+ throw new Error(`The ${versionFile} doesn't exist.`);
65278+ }
65279+ }
65280+ version = fs_1.default.readFileSync(versionFile, 'utf8');
65281+ core.info(`Resolved ${versionFile} as ${version}`);
65282+ return version;
6527465283 }
65275- version = fs_1.default.readFileSync(versionFile, 'utf8');
65276- core.info(`Resolved ${versionFile} as ${version}`);
65284+ core.warning("Neither 'python-version' nor 'python-version-file' inputs were supplied.");
6527765285 return version;
6527865286}
6527965287function run() {
@@ -65318,6 +65326,11 @@ function run() {
6531865326 }
6531965327 });
6532065328}
65329+ function logWarning(message) {
65330+ const warningPrefix = '[warning]';
65331+ core.info(`${warningPrefix}${message}`);
65332+ }
65333+ exports.logWarning = logWarning;
6532165334run();
6532265335
6532365336
0 commit comments