Skip to content

Commit

Permalink
[hotfix] Hotfix on finding env values if included more than one =
Browse files Browse the repository at this point in the history
  • Loading branch information
erdemkosk committed Nov 6, 2023
1 parent f7c317d commit d21821a
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 7 deletions.
17 changes: 11 additions & 6 deletions lib/env-operations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,12 @@ async function getValuesInEnv ({ targetPath }: { targetPath: string }): Promise<

for (const line of lines) {
if (line.trim() !== '') {
const parts: string[] = line.split('=')
if (parts.length === 2) {
data.push([parts[0], parts[1]])
const indexOfFirstEqualSign = line.indexOf('=')
if (indexOfFirstEqualSign >= 0) {
const envName = line.substring(0, indexOfFirstEqualSign)
const envValue = line.substring(indexOfFirstEqualSign + 1)

data.push([envName, envValue])
}
}
}
Expand Down Expand Up @@ -170,9 +173,11 @@ async function promptForEnvVariable (): Promise<string[]> {

for (const line of sourceLines) {
if (line.trim() !== '') {
const parts: string[] = line.split('=')
if (parts.length === 2) {
variables.add(parts[0])
const indexOfFirstEqualSign = line.indexOf('=')
if (indexOfFirstEqualSign >= 0) {
const envName = line.substring(0, indexOfFirstEqualSign)

variables.add(envName)
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "envolve",
"version": "1.0.2",
"version": "1.0.3",
"description": "Envolve CLI is a powerful tool for managing environment variables in your projects. It allows you to easily create, update, compare, and sync environment files across different services.",
"main": "index.ts",
"scripts": {
Expand Down

0 comments on commit d21821a

Please sign in to comment.