Skip to content

Commit c21ba63

Browse files
committed
Update dist.
1 parent 8947e37 commit c21ba63

File tree

1 file changed

+47
-39
lines changed

1 file changed

+47
-39
lines changed

dist/index.js

Lines changed: 47 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1428,55 +1428,63 @@ function run() {
14281428
const dash_ver = emacs_major_ver + "-" + emacs_minor_ver; // 27-1
14291429
const emacs_dot_var = "emacs-" + dot_ver; // emacs-27.1
14301430
core.startGroup("Installing Emacs");
1431-
const ftpUrl = "https://ftp.gnu.org/gnu/emacs/windows/emacs-" + emacs_major_ver + "/";
1431+
let ftpUrl = "https://ftp.gnu.org/gnu/emacs/windows/emacs-" + emacs_major_ver + "/";
14321432
let zipPath = ftpUrl + emacs_dot_var;
1433-
switch (dot_ver) {
1434-
case "23.4":
1435-
case "24.1":
1436-
case "24.2":
1437-
case "24.3": {
1438-
zipPath += "-bin-i386.zip";
1439-
break;
1440-
}
1441-
case "24.4": {
1442-
zipPath += "-bin-i686-pc-mingw32.zip";
1443-
break;
1444-
}
1445-
case "24.5": {
1446-
zipPath += "-bin-i686-mingw32.zip";
1447-
break;
1448-
}
1449-
case "25.1": {
1450-
zipPath += "-x86_64-w64-mingw32.zip";
1451-
break;
1452-
}
1453-
case "25.2":
1454-
case "25.3":
1455-
case "26.1":
1456-
case "26.2":
1457-
case "26.3":
1458-
case "27.1": {
1459-
zipPath += "-x86_64.zip";
1460-
break;
1461-
}
1462-
default: {
1463-
zipPath += "-x86_64.zip";
1464-
break;
1433+
if (version == "snapshot") {
1434+
// NOTE: If snapshot, directly assign the newest version.
1435+
// Current newest snaptshot is `28.0.50`.
1436+
zipPath = "https://alpha.gnu.org/gnu/emacs/pretest/windows/emacs-28/emacs-28.0.50-snapshot-2020-07-05-x86_64.zip";
1437+
}
1438+
else {
1439+
switch (dot_ver) {
1440+
case "23.4":
1441+
case "24.1":
1442+
case "24.2":
1443+
case "24.3": {
1444+
zipPath += "-bin-i386.zip";
1445+
break;
1446+
}
1447+
case "24.4": {
1448+
zipPath += "-bin-i686-pc-mingw32.zip";
1449+
break;
1450+
}
1451+
case "24.5": {
1452+
zipPath += "-bin-i686-mingw32.zip";
1453+
break;
1454+
}
1455+
case "25.1": {
1456+
zipPath += "-x86_64-w64-mingw32.zip";
1457+
break;
1458+
}
1459+
case "25.2":
1460+
case "25.3":
1461+
case "26.1":
1462+
case "26.2":
1463+
case "26.3":
1464+
case "27.1": {
1465+
zipPath += "-x86_64.zip";
1466+
break;
1467+
}
1468+
default: {
1469+
zipPath += "-x86_64.zip";
1470+
break;
1471+
}
14651472
}
14661473
}
1467-
const extractPath = __dirname + "\\..\\temp";
1474+
const extractPath = "c:\\emacs";
14681475
if (!fs_1.default.existsSync(extractPath)) {
14691476
fs_1.default.mkdirSync(extractPath);
14701477
}
14711478
const emacsZip = yield tc.downloadTool(zipPath);
14721479
const emacsDir = yield tc.extractZip(emacsZip, extractPath);
1473-
let emacsBin = emacsDir + "\\bin";
1480+
let emacsRoot = emacsDir;
1481+
let emacsBin = emacsRoot + "\\bin";
14741482
if (!fs_1.default.existsSync(emacsBin)) {
1475-
emacsBin = emacsDir + "\\" + emacs_dot_var + "\\bin";
1483+
emacsRoot = emacsDir + "\\" + emacs_dot_var;
1484+
emacsBin = emacsRoot + "\\bin"; // Refresh
14761485
}
1477-
const cachtedPath = yield tc.cacheDir(emacsBin, "emacs", dot_ver);
1478-
core.addPath(cachtedPath);
1479-
core.exportVariable("PATH", "%PATH%;" + emacsBin);
1486+
core.exportVariable("PATH", `${PATH};${emacsRoot}`);
1487+
core.exportVariable("PATH", `${PATH};${emacsBin}`);
14801488
core.endGroup();
14811489
}
14821490
catch (error) {

0 commit comments

Comments
 (0)