-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
15 additions
and
13 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
#!/usr/bin/env nu | ||
# Author: hustcer | ||
# Created: 2023/09/10 18:36:56 | ||
# Usage: | ||
# use source command to load it | ||
|
||
|
||
# Get the specified env key's value or '' | ||
export def 'get-env' [ | ||
key: string # The key to get it's env value | ||
default?: string # The default value for an empty env | ||
] { | ||
$env | get -i $key | default $default | ||
} |