From 5901652c7df3812019f0a112b7b75c97061dc46d Mon Sep 17 00:00:00 2001 From: shu Date: Tue, 15 Oct 2024 17:00:32 +0900 Subject: [PATCH] fix bug of push-secrets: The variable content may contain single quotes. --- src/commands/setup/push-secrets.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/commands/setup/push-secrets.ts b/src/commands/setup/push-secrets.ts index 0241850..14f58a1 100644 --- a/src/commands/setup/push-secrets.ts +++ b/src/commands/setup/push-secrets.ts @@ -33,7 +33,7 @@ class AWSSecretService implements SecretService { } private async pushToAWSSecret(content: string, secretName: string): Promise { - const command = `aws secretsmanager create-secret --name "${this.prefixName}/${secretName}" --secret-string '${content}' --region ${this.region}` + const command = `aws secretsmanager create-secret --name "${this.prefixName}/${secretName}" --secret-string "${JSON.stringify(content).slice(1, -1)}" --region ${this.region}` try { await execAsync(command) console.log(chalk.green(`Successfully pushed secret: ${this.prefixName}/${secretName}`))