Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions lib/ssh.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,11 @@ export async function setupSshCredentials(): Promise<void> {
const identityFile = `${sshConfigDir}/id_rsa_tmp`;
const knownHostsFile = `${sshConfigDir}/known_hosts`;

// Ensure the SSH directory exists
// Ensure the SSH directory exists, when `stat` throws an error, we know the directory doesn't exist
const sshDirExists = await fs.promises
.stat(sshDir)
.then((stat) => stat.isDirectory());
.then((stat) => stat.isDirectory())
.catch((err) => false);
if (!sshDirExists) {
await fs.promises.mkdir(sshDir, { recursive: true });
}
Expand Down