-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add option to add overrides, or provide extra variables at call…
…-time
- Loading branch information
Showing
3 changed files
with
38 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
export function parseEnvEntry(entry: string, previous: Record<string, string>): Record<string, string> { | ||
const delimiterIndex = entry.indexOf('='); | ||
const key = entry.slice(0, delimiterIndex); | ||
const value = entry.slice(delimiterIndex + 1); | ||
|
||
return { | ||
...previous, | ||
[key]: value, | ||
}; | ||
} | ||
|
||
export function serializeEnv(env: Record<string, string>): string { | ||
return Object.entries(env) | ||
.map(([key, value]) => `${key}="${value}"`) | ||
.join('\n'); | ||
} |