scripts/adi_env.tcl: helper function for environment variables
Ease the access of the environment variables.main
parent
1b0a47c101
commit
1f7671cb36
|
@ -15,3 +15,17 @@ if [info exists ::env(ADI_GHDL_DIR)] {
|
|||
set ad_ghdl_dir [file normalize $::env(ADI_GHDL_DIR)]
|
||||
}
|
||||
|
||||
|
||||
# This helper pocedure retrieves the value of varible from environment if exists,
|
||||
# other case returns the provided default value
|
||||
# name - name of the environment variable
|
||||
# default_value - returned vale in case environment variable does not exists
|
||||
proc get_env_param {name default_value} {
|
||||
if [info exists ::env($name)] {
|
||||
return $::env($name)
|
||||
} else {
|
||||
return $default_value
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue