Skip to content

Commit ce43061

Browse files
committed
error on missing key
1 parent 6c3ebba commit ce43061

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

packages/core/src/awsService/ec2/sshKeyPair.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ export class SshKeyPair {
3434

3535
public static async generateSshKeyPair(keyPath: string): Promise<void> {
3636
const keyGenerated = await this.tryKeyTypes(keyPath, ['ed25519', 'rsa'])
37-
if (!keyGenerated) {
37+
if (!keyGenerated || !(await fs.existsFile(keyPath))) {
3838
throw new ToolkitError('ec2: Unable to generate ssh key pair')
3939
}
4040
await fs.chmod(keyPath, 0o600)

0 commit comments

Comments
 (0)