@@ -65241,6 +65241,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
65241
65241
return (mod && mod.__esModule) ? mod : { "default": mod };
65242
65242
};
65243
65243
Object.defineProperty(exports, "__esModule", ({ value: true }));
65244
+ exports.logWarning = void 0;
65244
65245
const core = __importStar(__nccwpck_require__(2186));
65245
65246
const finder = __importStar(__nccwpck_require__(9996));
65246
65247
const finderPyPy = __importStar(__nccwpck_require__(4003));
@@ -65263,17 +65264,24 @@ function resolveVersionInput() {
65263
65264
let version = core.getInput('python-version');
65264
65265
let versionFile = core.getInput('python-version-file');
65265
65266
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. ');
65267
65268
}
65268
65269
if (version) {
65269
65270
return version;
65270
65271
}
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;
65274
65283
}
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.");
65277
65285
return version;
65278
65286
}
65279
65287
function run() {
@@ -65318,6 +65326,11 @@ function run() {
65318
65326
}
65319
65327
});
65320
65328
}
65329
+ function logWarning(message) {
65330
+ const warningPrefix = '[warning]';
65331
+ core.info(`${warningPrefix}${message}`);
65332
+ }
65333
+ exports.logWarning = logWarning;
65321
65334
run();
65322
65335
65323
65336
0 commit comments