mirror of
https://github.com/asdf-vm/asdf.git
synced 2024-11-15 09:38:16 -07:00
Merge pull request #300 from fallwith/master
AZDF_CONFIG_FILE -> ASDF_CONFIG_FILE typo fix
This commit is contained in:
commit
e2ffb29ef6
@ -226,7 +226,7 @@ legacy_version_file = yes
|
|||||||
|
|
||||||
## Environment Variables
|
## Environment Variables
|
||||||
|
|
||||||
* `AZDF_CONFIG_FILE` - Defaults to `~/.asdfrc` as described above. Can be set to any location.
|
* `ASDF_CONFIG_FILE` - Defaults to `~/.asdfrc` as described above. Can be set to any location.
|
||||||
* `ASDF_DEFAULT_TOOL_VERSIONS_FILENAME` - The name of the file storing the tool names and versions. Defaults to `.tool-versions`. Can be any valid file name.
|
* `ASDF_DEFAULT_TOOL_VERSIONS_FILENAME` - The name of the file storing the tool names and versions. Defaults to `.tool-versions`. Can be any valid file name.
|
||||||
|
|
||||||
## Uninstall
|
## Uninstall
|
||||||
|
@ -286,8 +286,8 @@ get_asdf_config_value_from_file() {
|
|||||||
|
|
||||||
get_asdf_config_value() {
|
get_asdf_config_value() {
|
||||||
local key=$1
|
local key=$1
|
||||||
local config_path=${AZDF_CONFIG_FILE:-"$HOME/.asdfrc"}
|
local config_path=${ASDF_CONFIG_FILE:-"$HOME/.asdfrc"}
|
||||||
local default_config_path=${AZDF_CONFIG_DEFAULT_FILE:-"$(asdf_dir)/defaults"}
|
local default_config_path=${ASDF_CONFIG_DEFAULT_FILE:-"$(asdf_dir)/defaults"}
|
||||||
|
|
||||||
local result
|
local result
|
||||||
result=$(get_asdf_config_value_from_file "$config_path" "$key")
|
result=$(get_asdf_config_value_from_file "$config_path" "$key")
|
||||||
|
@ -3,14 +3,14 @@
|
|||||||
load test_helpers
|
load test_helpers
|
||||||
|
|
||||||
setup() {
|
setup() {
|
||||||
AZDF_CONFIG_FILE=$BATS_TMPDIR/asdfrc
|
ASDF_CONFIG_FILE=$BATS_TMPDIR/asdfrc
|
||||||
cat > $AZDF_CONFIG_FILE <<-EOM
|
cat > $ASDF_CONFIG_FILE <<-EOM
|
||||||
key1 = value1
|
key1 = value1
|
||||||
legacy_version_file = yes
|
legacy_version_file = yes
|
||||||
EOM
|
EOM
|
||||||
|
|
||||||
AZDF_CONFIG_DEFAULT_FILE=$BATS_TMPDIR/asdfrc_defaults
|
ASDF_CONFIG_DEFAULT_FILE=$BATS_TMPDIR/asdfrc_defaults
|
||||||
cat > $AZDF_CONFIG_DEFAULT_FILE <<-EOM
|
cat > $ASDF_CONFIG_DEFAULT_FILE <<-EOM
|
||||||
# i have a comment, it's ok
|
# i have a comment, it's ok
|
||||||
key2 = value2
|
key2 = value2
|
||||||
legacy_version_file = no
|
legacy_version_file = no
|
||||||
@ -18,14 +18,14 @@ EOM
|
|||||||
}
|
}
|
||||||
|
|
||||||
teardown() {
|
teardown() {
|
||||||
rm $AZDF_CONFIG_FILE
|
rm $ASDF_CONFIG_FILE
|
||||||
rm $AZDF_CONFIG_DEFAULT_FILE
|
rm $ASDF_CONFIG_DEFAULT_FILE
|
||||||
unset AZDF_CONFIG_DEFAULT_FILE
|
unset ASDF_CONFIG_DEFAULT_FILE
|
||||||
unset AZDF_CONFIG_FILE
|
unset ASDF_CONFIG_FILE
|
||||||
}
|
}
|
||||||
|
|
||||||
@test "get_config returns default when config file does not exist" {
|
@test "get_config returns default when config file does not exist" {
|
||||||
result=$(AZDF_CONFIG_FILE="/some/fake/path" get_asdf_config_value "legacy_version_file")
|
result=$(ASDF_CONFIG_FILE="/some/fake/path" get_asdf_config_value "legacy_version_file")
|
||||||
[ "$result" = "no" ]
|
[ "$result" = "no" ]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user