Skip to content

Commit 099ed89

Browse files
author
IvanZosimov
committed
Optimize code
1 parent ccb7da8 commit 099ed89

File tree

2 files changed

+8
-13
lines changed

2 files changed

+8
-13
lines changed

dist/setup/index.js

+4-6
Original file line numberDiff line numberDiff line change
@@ -65271,12 +65271,10 @@ function resolveVersionInput() {
6527165271
}
6527265272
if (versionFile) {
6527365273
if (!fs_1.default.existsSync(versionFile)) {
65274-
logWarning(`The specified python version file at: ${versionFile} does not exist. Attempting to find .python-version file.`);
65275-
if (!fs_1.default.existsSync('.python-version')) {
65276-
throw new Error(`The specified python version file at: ${versionFile} does not exist and default .python-version file isn't found.`);
65277-
}
65278-
else {
65279-
versionFile = '.python-version';
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.`);
6528065278
}
6528165279
}
6528265280
version = fs_1.default.readFileSync(versionFile, 'utf8');

src/setup-python.ts

+4-7
Original file line numberDiff line numberDiff line change
@@ -39,14 +39,11 @@ function resolveVersionInput(): string {
3939
if (versionFile) {
4040
if (!fs.existsSync(versionFile)) {
4141
logWarning(
42-
`The specified python version file at: ${versionFile} does not exist. Attempting to find .python-version file.`
42+
`The specified python version file at: ${versionFile} doesn't exist. Attempting to find .python-version file.`
4343
);
44-
if (!fs.existsSync('.python-version')) {
45-
throw new Error(
46-
`The specified python version file at: ${versionFile} does not exist and default .python-version file isn't found.`
47-
);
48-
} else {
49-
versionFile = '.python-version';
44+
versionFile = '.python-version';
45+
if (!fs.existsSync(versionFile)) {
46+
throw new Error(`The ${versionFile} doesn't exist.`);
5047
}
5148
}
5249

0 commit comments

Comments
 (0)