Skip to content

Commit bb69e0f

Browse files
committed
Fixed logic not.
1 parent 2bfa0f7 commit bb69e0f

File tree

2 files changed

+15
-10
lines changed

2 files changed

+15
-10
lines changed

dist/index.js

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1409,22 +1409,25 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
14091409
step((generator = generator.apply(thisArg, _arguments || [])).next());
14101410
});
14111411
};
1412+
var __importDefault = (this && this.__importDefault) || function (mod) {
1413+
return (mod && mod.__esModule) ? mod : { "default": mod };
1414+
};
14121415
Object.defineProperty(exports, "__esModule", { value: true });
14131416
const core = __importStar(__webpack_require__(186));
14141417
const exec = __importStar(__webpack_require__(514));
14151418
const tc = __importStar(__webpack_require__(784));
1419+
const fs_1 = __importDefault(__webpack_require__(747));
14161420
function run() {
14171421
return __awaiter(this, void 0, void 0, function* () {
14181422
try {
14191423
const PATH = process.env.PATH;
14201424
const version = core.getInput("version");
1421-
const ver_lst = version.split(".");
1422-
const emacs_major_ver = ver_lst[0];
1423-
const emacs_minor_ver = ver_lst[1];
1424-
const dot_ver = emacs_major_ver + "." + emacs_minor_ver;
1425-
const dash_ver = emacs_major_ver + "-" + emacs_minor_ver;
1426-
const emacs_dot_var = "emacs-" + dot_ver;
1427-
const emacs_dash_ver = "emacs-" + dash_ver;
1425+
const ver_lst = version.split("."); // if 27.1
1426+
const emacs_major_ver = ver_lst[0]; // 27
1427+
const emacs_minor_ver = ver_lst[1]; // 1
1428+
const dot_ver = emacs_major_ver + "." + emacs_minor_ver; // 27.1
1429+
const dash_ver = emacs_major_ver + "-" + emacs_minor_ver; // 27-1
1430+
const emacs_dot_var = "emacs-" + dot_ver; // emacs-27.1
14281431
core.startGroup("Installing Emacs");
14291432
const ftpUrl = "https://ftp.gnu.org/gnu/emacs/windows/emacs-" + emacs_major_ver + "/";
14301433
let zipPath = ftpUrl + emacs_dot_var;
@@ -1465,7 +1468,10 @@ function run() {
14651468
const emacsZip = yield tc.downloadTool(zipPath);
14661469
const emacsDir = yield tc.extractZip(emacsZip, __dirname);
14671470
yield exec.exec("dir dist");
1468-
const emacsBin = emacsDir + "\\bin";
1471+
let emacsBin = emacsDir + "\\bin";
1472+
if (fs_1.default.existsSync(emacsBin)) {
1473+
emacsBin = emacsDir + "\\" + emacs_dot_var + "\\bin";
1474+
}
14691475
console.log("emacsBin: " + emacsBin);
14701476
const cachtedPath = yield tc.cacheDir(emacsBin, "emacs", dot_ver);
14711477
core.addPath(cachtedPath);

src/main.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,7 @@ async function run(): Promise<void> {
6161
await exec.exec("dir dist");
6262

6363
let emacsBin = emacsDir + "\\bin";
64-
65-
if (fs.existsSync(emacsBin)) {
64+
if (!fs.existsSync(emacsBin)) {
6665
emacsBin = emacsDir + "\\" + emacs_dot_var + "\\bin";
6766
}
6867

0 commit comments

Comments
 (0)