Skip to content

Commit

Permalink
A small fix
Browse files Browse the repository at this point in the history
  • Loading branch information
ysdragon committed Sep 2, 2024
1 parent 9a88ca1 commit 5653063
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions lib.ring
Original file line number Diff line number Diff line change
Expand Up @@ -38,16 +38,15 @@ class dotenv {
if(line != "" and not startsWith(line, "#")) {
// Split the line into key and value
parts = split(line, "=")
// Get the key
key = trim(parts[1])
// Initialize value as empty string
value = ""
// If there are more than 2 parts, append the remaining parts as the value
if(len(parts) > 2) {
value = parts[2] + "="
elseif (len(parts) = 2)
// If there are less than 2 parts, make value empty
if (len(parts) < 2) {
value = ""
else
// Get the value
value = trim(parts[2])
}
// Get the key
key = trim(parts[1])
// Store in the list
envVars[key] = value
}
Expand Down

0 comments on commit 5653063

Please sign in to comment.