Skip to content

Commit 5901652

Browse files
committed
fix bug of push-secrets:
The variable content may contain single quotes.
1 parent 69c6e7c commit 5901652

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/commands/setup/push-secrets.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ class AWSSecretService implements SecretService {
3333
}
3434

3535
private async pushToAWSSecret(content: string, secretName: string): Promise<void> {
36-
const command = `aws secretsmanager create-secret --name "${this.prefixName}/${secretName}" --secret-string '${content}' --region ${this.region}`
36+
const command = `aws secretsmanager create-secret --name "${this.prefixName}/${secretName}" --secret-string "${JSON.stringify(content).slice(1, -1)}" --region ${this.region}`
3737
try {
3838
await execAsync(command)
3939
console.log(chalk.green(`Successfully pushed secret: ${this.prefixName}/${secretName}`))

0 commit comments

Comments
 (0)