Skip to content

Commit

Permalink
feat: tweak confirm messages for better DX
Browse files Browse the repository at this point in the history
  • Loading branch information
maxigimenez committed Aug 30, 2024
1 parent 4b25caa commit e0f21fe
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
5 changes: 4 additions & 1 deletion packages/cli/src/commands/env/add.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,10 @@ export default class EnvAdd extends AuthCommand {
}
try {
await api.environmentVariables.add(envVariableName, envValue, locked, secret)
this.log(`Environment variable ${envVariableName} added.`)
this.log(secret
? `Secret environment variable ${envVariableName} added.`
: `Environment variable ${envVariableName} added.`,
)
} catch (err: any) {
if (err?.response?.status === 409) {
throw new Error(`Environment variable ${envVariableName} already exists.`)
Expand Down
5 changes: 4 additions & 1 deletion packages/cli/src/commands/env/update.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,10 @@ export default class EnvUpdate extends AuthCommand {
}
try {
await api.environmentVariables.update(envVariableName, envValue, locked, secret)
this.log(`Environment variable ${envVariableName} updated.`)
this.log(secret
? `Secret environment variable ${envVariableName} updated.`
: `Environment variable ${envVariableName} updated.`,
)
} catch (err: any) {
if (err?.response?.status === 400 && err?.response?.data?.message) {
throw new Error(err.response.data.message)
Expand Down

0 comments on commit e0f21fe

Please sign in to comment.