We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 7c08ee6 + 60911ea commit 3b7d5b7Copy full SHA for 3b7d5b7
lib/ssh.ts
@@ -15,10 +15,11 @@ export async function setupSshCredentials(): Promise<void> {
15
const identityFile = `${sshConfigDir}/id_rsa_tmp`;
16
const knownHostsFile = `${sshConfigDir}/known_hosts`;
17
18
- // Ensure the SSH directory exists
+ // Ensure the SSH directory exists, when `stat` throws an error, we know the directory doesn't exist
19
const sshDirExists = await fs.promises
20
.stat(sshDir)
21
- .then((stat) => stat.isDirectory());
+ .then((stat) => stat.isDirectory())
22
+ .catch((err) => false);
23
if (!sshDirExists) {
24
await fs.promises.mkdir(sshDir, { recursive: true });
25
}
0 commit comments