Skip to content

Commit 00f89a6

Browse files
committed
um
1 parent 340b607 commit 00f89a6

File tree

2 files changed

+10
-8
lines changed

2 files changed

+10
-8
lines changed

dist/index.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30995,14 +30995,14 @@ function download_file(url, filename) {
3099530995
};
3099630996

3099730997
function ensure_host_ssh_key() {
30998-
const pubkey = expandHomeDir("~/.ssh/id_rsa.pub");
30999-
const privkey = expandHomeDir("~/.ssh/id_rsa");
31000-
if (fs.existsSync(pubkey)) {
30998+
const pubkeyPath = expandHomeDir("~/.ssh/id_rsa.pub");
30999+
const privkeyPath = expandHomeDir("~/.ssh/id_rsa");
31000+
if (fs.existsSync(pubkeyPath)) {
3100131001
show_message("info", "SSH key already exists, skipping.");
3100231002
} else {
3100331003
const result = spawnSync(
3100431004
"ssh-keygen",
31005-
["-t", "rsa", "-N", "", "-f", privkey],
31005+
["-t", "rsa", "-N", "", "-f", privkeyPath],
3100631006
{
3100731007
stdio: "inherit",
3100831008
}
@@ -31016,6 +31016,7 @@ function ensure_host_ssh_key() {
3101631016
);
3101731017
}
3101831018
}
31019+
const pubkey = fs.readFileSync(pubkeyPath, "utf8");
3101931020
return pubkey;
3102031021
};
3102131022

index.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -105,14 +105,14 @@ function download_file(url, filename) {
105105
};
106106

107107
function ensure_host_ssh_key() {
108-
const pubkey = expandHomeDir("~/.ssh/id_rsa.pub");
109-
const privkey = expandHomeDir("~/.ssh/id_rsa");
110-
if (fs.existsSync(pubkey)) {
108+
const pubkeyPath = expandHomeDir("~/.ssh/id_rsa.pub");
109+
const privkeyPath = expandHomeDir("~/.ssh/id_rsa");
110+
if (fs.existsSync(pubkeyPath)) {
111111
show_message("info", "SSH key already exists, skipping.");
112112
} else {
113113
const result = spawnSync(
114114
"ssh-keygen",
115-
["-t", "rsa", "-N", "", "-f", privkey],
115+
["-t", "rsa", "-N", "", "-f", privkeyPath],
116116
{
117117
stdio: "inherit",
118118
}
@@ -126,6 +126,7 @@ function ensure_host_ssh_key() {
126126
);
127127
}
128128
}
129+
const pubkey = fs.readFileSync(pubkeyPath, "utf8");
129130
return pubkey;
130131
};
131132

0 commit comments

Comments
 (0)