Skip to content

Commit

Permalink
fix(env.ts): no need of double double quotes (#372)
Browse files Browse the repository at this point in the history
* fix(env.ts): no need of double double quotes

* chore: changesets

---------

Co-authored-by: Pkmmte Xeleon <[email protected]>
  • Loading branch information
ArnavK-09 and Pkmmte authored Nov 16, 2024
1 parent f66cb66 commit 43f86f4
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
5 changes: 5 additions & 0 deletions .changeset/strong-hats-rescue.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'create-robo': patch
---

fix: no need of double double quotes
9 changes: 1 addition & 8 deletions packages/create-robo/src/env.ts
Original file line number Diff line number Diff line change
Expand Up @@ -135,14 +135,7 @@ export class Env {

private escapeValue(value: string): string {
// Escape backslashes and double quotes
const escaped = value.replace(/\\/g, '\\\\').replace(/"/g, '\\"')

// Determine if the value needs to be quoted
if (/[\s#=]/.test(value)) {
return `"${escaped}"`
} else {
return escaped
}
return value.replace(/\\/g, '\\\\').replace(/"/g, '\\"')
}

/**
Expand Down

0 comments on commit 43f86f4

Please sign in to comment.