Skip to content

Commit e8fce36

Browse files
committed
Split version detailed.
1 parent 207ddbd commit e8fce36

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

src/main.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,14 @@ import * as tc from "@actions/tool-cache";
66
async function run(): Promise<void> {
77
try {
88
const version = core.getInput("version");
9-
const emacs_dot_var = "emacs-" + version;
10-
const emacs_dash_ver = emacs_dot_var.replace(".", "-");
9+
const ver_lst = version.split(".");
10+
const emacs_major_ver = ver_lst[0];
11+
const emacs_minor_ver = ver_lst[1];
12+
const emacs_dot_var = "emacs-" + emacs_major_ver + "." + emacs_minor_ver;
13+
const emacs_dash_ver = "emacs-" + emacs_major_ver + "-" + emacs_minor_ver;
1114

1215
core.startGroup("Installing Emacs");
13-
const ftpUrl = "https://ftp.gnu.org/gnu/emacs/windows/" + emacs_dash_ver + "/";
16+
const ftpUrl = "https://ftp.gnu.org/gnu/emacs/windows/" + emacs_major_ver + "/";
1417
let zipPath = ftpUrl + emacs_dot_var;
1518

1619
switch (emacs_dot_var) {

0 commit comments

Comments
 (0)