Fix the env variable to set when it does not exist
This commit is contained in:
parent
0cec462621
commit
ce0266831f
@ -95,8 +95,8 @@ function default() {
|
||||
# 0 if the env variable exists, 3 if it was set
|
||||
#
|
||||
function env_default() {
|
||||
env | grep -q "^$1=" && return 0
|
||||
export "$1=$2" && return 3
|
||||
[[ -z "$1" && ${env | grep -q "^$1="} ]] && return 0
|
||||
export "$1=$2" && return 3
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user