Skip to content

Commit

Permalink
std/os: add the Getenv function
Browse files Browse the repository at this point in the history
  • Loading branch information
mertcandav committed Nov 22, 2024
1 parent 9d98619 commit 807c9a4
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions std/os/proc.jule
Original file line number Diff line number Diff line change
Expand Up @@ -47,4 +47,12 @@ fn Chdir(path: str)! {
if !ok {
error(getLastOsError())
}
}

// Retrieves the value of the environment variable named by the key.
// It returns the value, which will be empty if the variable is not present.
// To distinguish between an empty value and an unset value, use [LookupEnv].
fn Getenv(key: str): str {
v, _ := LookupEnv(key)
ret v
}

0 comments on commit 807c9a4

Please sign in to comment.