Skip to content

Commit

Permalink
Revert "um"
Browse files Browse the repository at this point in the history
This reverts commit 00f89a6.
  • Loading branch information
shinohara-rin committed May 3, 2024
1 parent 00f89a6 commit dc465f0
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 10 deletions.
9 changes: 4 additions & 5 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -30995,14 +30995,14 @@ function download_file(url, filename) {
};

function ensure_host_ssh_key() {
const pubkeyPath = expandHomeDir("~/.ssh/id_rsa.pub");
const privkeyPath = expandHomeDir("~/.ssh/id_rsa");
if (fs.existsSync(pubkeyPath)) {
const pubkey = expandHomeDir("~/.ssh/id_rsa.pub");
const privkey = expandHomeDir("~/.ssh/id_rsa");
if (fs.existsSync(pubkey)) {
show_message("info", "SSH key already exists, skipping.");
} else {
const result = spawnSync(
"ssh-keygen",
["-t", "rsa", "-N", "", "-f", privkeyPath],
["-t", "rsa", "-N", "", "-f", privkey],
{
stdio: "inherit",
}
Expand All @@ -31016,7 +31016,6 @@ function ensure_host_ssh_key() {
);
}
}
const pubkey = fs.readFileSync(pubkeyPath, "utf8");
return pubkey;
};

Expand Down
9 changes: 4 additions & 5 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -105,14 +105,14 @@ function download_file(url, filename) {
};

function ensure_host_ssh_key() {
const pubkeyPath = expandHomeDir("~/.ssh/id_rsa.pub");
const privkeyPath = expandHomeDir("~/.ssh/id_rsa");
if (fs.existsSync(pubkeyPath)) {
const pubkey = expandHomeDir("~/.ssh/id_rsa.pub");
const privkey = expandHomeDir("~/.ssh/id_rsa");
if (fs.existsSync(pubkey)) {
show_message("info", "SSH key already exists, skipping.");
} else {
const result = spawnSync(
"ssh-keygen",
["-t", "rsa", "-N", "", "-f", privkeyPath],
["-t", "rsa", "-N", "", "-f", privkey],
{
stdio: "inherit",
}
Expand All @@ -126,7 +126,6 @@ function ensure_host_ssh_key() {
);
}
}
const pubkey = fs.readFileSync(pubkeyPath, "utf8");
return pubkey;
};

Expand Down

0 comments on commit dc465f0

Please sign in to comment.