Merge pull request #300 from fallwith/master

AZDF_CONFIG_FILE -> ASDF_CONFIG_FILE typo fix
This commit is contained in:
Trevor Brown 2018-02-27 15:13:36 -05:00 committed by GitHub
commit e2ffb29ef6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 12 additions and 12 deletions

View File

@ -226,7 +226,7 @@ legacy_version_file = yes
## 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.
## Uninstall

View File

@ -286,8 +286,8 @@ get_asdf_config_value_from_file() {
get_asdf_config_value() {
local key=$1
local config_path=${AZDF_CONFIG_FILE:-"$HOME/.asdfrc"}
local default_config_path=${AZDF_CONFIG_DEFAULT_FILE:-"$(asdf_dir)/defaults"}
local config_path=${ASDF_CONFIG_FILE:-"$HOME/.asdfrc"}
local default_config_path=${ASDF_CONFIG_DEFAULT_FILE:-"$(asdf_dir)/defaults"}
local result
result=$(get_asdf_config_value_from_file "$config_path" "$key")

View File

@ -3,14 +3,14 @@
load test_helpers
setup() {
AZDF_CONFIG_FILE=$BATS_TMPDIR/asdfrc
cat > $AZDF_CONFIG_FILE <<-EOM
ASDF_CONFIG_FILE=$BATS_TMPDIR/asdfrc
cat > $ASDF_CONFIG_FILE <<-EOM
key1 = value1
legacy_version_file = yes
EOM
AZDF_CONFIG_DEFAULT_FILE=$BATS_TMPDIR/asdfrc_defaults
cat > $AZDF_CONFIG_DEFAULT_FILE <<-EOM
ASDF_CONFIG_DEFAULT_FILE=$BATS_TMPDIR/asdfrc_defaults
cat > $ASDF_CONFIG_DEFAULT_FILE <<-EOM
# i have a comment, it's ok
key2 = value2
legacy_version_file = no
@ -18,14 +18,14 @@ EOM
}
teardown() {
rm $AZDF_CONFIG_FILE
rm $AZDF_CONFIG_DEFAULT_FILE
unset AZDF_CONFIG_DEFAULT_FILE
unset AZDF_CONFIG_FILE
rm $ASDF_CONFIG_FILE
rm $ASDF_CONFIG_DEFAULT_FILE
unset ASDF_CONFIG_DEFAULT_FILE
unset ASDF_CONFIG_FILE
}
@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" ]
}