Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(cli-helpers): Don't add spaces around = for env vars #11414

Merged
merged 2 commits into from
Sep 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .changesets/11414.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
- fix(cli-helpers): Don't add spaces around `=` for env vars (#11414) by @Tobbe

The `addEnvVar` helper function in `packages/cli-helpers` no longer adds spaces around `=` when setting environment variables.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ exports[`addEnvVar > addEnvVar adds environment variables as part of a setup tas

# Note: The existing environment variable EXISTING_VAR was not overwritten. Uncomment to use its new value.
# Updated existing variable Comment
# EXISTING_VAR = new_value
# EXISTING_VAR=new_value
"
`;

Expand All @@ -15,7 +15,7 @@ exports[`addEnvVar > addEnvVar adds environment variables as part of a setup tas
# CommentedVar = 123

# New Variable Comment
NEW_VAR = new_value
NEW_VAR=new_value
"
`;

Expand All @@ -24,7 +24,7 @@ exports[`addEnvVar > addEnvVar adds environment variables as part of a setup tas
# CommentedVar = 123

# New Variable Comment
NEW_VAR = new_value
NEW_VAR=new_value
"
`;

Expand All @@ -34,7 +34,7 @@ exports[`addEnvVar > addEnvVar adds environment variables as part of a setup tas

# Note: The existing environment variable EXISTING_VAR was not overwritten. Uncomment to use its new value.
# New Variable Comment
# EXISTING_VAR = new_value
# EXISTING_VAR=new_value
"
`;

Expand Down
4 changes: 2 additions & 2 deletions packages/cli-helpers/src/lib/project.ts
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ export const addEnvVar = (name: string, value: string, comment: string) => {
let envFile = ''
const newEnvironmentVariable = [
comment && `# ${comment}`,
`${name} = ${value}`,
`${name}=${value}`,
'',
]
.flat()
Expand All @@ -144,7 +144,7 @@ export const addEnvVar = (name: string, value: string, comment: string) => {
const p = [
`# Note: The existing environment variable ${name} was not overwritten. Uncomment to use its new value.`,
comment && `# ${comment}`,
`# ${name} = ${value}`,
`# ${name}=${value}`,
'',
]
.flat()
Expand Down
Loading