Merge branch 'master' into master

This commit is contained in:
Bruno Sales Cardoso 2024-08-30 18:24:09 +01:00 committed by GitHub
commit 437453110c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
8 changed files with 34 additions and 12 deletions

View File

@ -1,5 +1,12 @@
# Changelog
## [0.14.1](https://github.com/asdf-vm/asdf/compare/v0.14.0...v0.14.1) (2024-08-15)
### Patches
* Only display the "can't keep downloads" warning when asked to keep downloads ([#1756](https://github.com/asdf-vm/asdf/issues/1756)) ([44f3efb](https://github.com/asdf-vm/asdf/commit/44f3efb63b7517520f4610d504d30783a85c9d79))
## [0.14.0](https://github.com/asdf-vm/asdf/compare/v0.13.1...v0.14.0) (2024-01-19)

View File

@ -9,7 +9,7 @@ not covered under this security policy.**
<!-- x-release-please-start-version -->
```
0.14.0
0.14.1
```
<!-- x-release-please-end -->

View File

@ -36,7 +36,7 @@ asdf primarily requires `git` & `curl`. Here is a _non-exhaustive_ list of comma
```shell
git clone https://github.com/asdf-vm/asdf.git ~/.asdf --branch v0.14.0
git clone https://github.com/asdf-vm/asdf.git ~/.asdf --branch v0.14.1
```

View File

@ -39,7 +39,7 @@ asdf primarily requires `git` & `curl`. Here is a _non-exhaustive_ list of comma
<!-- x-release-please-start-version -->
```shell
git clone https://github.com/asdf-vm/asdf.git ~/.asdf --branch v0.14.0
git clone https://github.com/asdf-vm/asdf.git ~/.asdf --branch v0.14.1
```
<!-- x-release-please-end -->

View File

@ -35,7 +35,7 @@ asdf primarily requires `git` & `curl`. Here is a _non-exhaustive_ list of comma
<!-- x-release-please-start-version -->
```shell
git clone https://github.com/asdf-vm/asdf.git ~/.asdf --branch v0.14.0
git clone https://github.com/asdf-vm/asdf.git ~/.asdf --branch v0.14.1
```
<!-- x-release-please-end -->

View File

@ -234,15 +234,16 @@ install_tool_version() {
local install_exit_code=$?
if [ $install_exit_code -eq 0 ] && [ $download_exit_code -eq 0 ]; then
# Remove download directory if --keep-download flag or always_keep_download config setting are not set
# If the download directory should be kept, but isn't available, warn the user
always_keep_download=$(get_asdf_config_value "always_keep_download")
if [ ! "$keep_download" = "true" ] && [ ! "$always_keep_download" = "yes" ]; then
if [ -d "$download_path" ]; then
rm -r "$download_path"
else
if [ "$keep_download" = "true" ] || [ "$always_keep_download" = "yes" ]; then
if [ ! -d "$download_path" ]; then
printf '%s\n' "asdf: Warn: You have configured asdf to preserve downloaded files (with always_keep_download=yes or --keep-download). But" >&2
printf '%s\n' "asdf: Warn: the current plugin ($plugin_name) does not support that. Downloaded files will not be preserved." >&2
fi
# Otherwise, remove the download directory if it exists
elif [ -d "$download_path" ]; then
rm -r "$download_path"
fi
reshim_command "$plugin_name" "$full_version"

View File

@ -7,6 +7,7 @@ setup() {
install_dummy_legacy_plugin
install_dummy_plugin
install_dummy_broken_plugin
install_dummy_plugin_no_download
PROJECT_DIR="$HOME/project"
mkdir -p "$PROJECT_DIR"
@ -302,11 +303,24 @@ EOM
[ "$output" = "Download failed!" ]
}
@test "install_command prints info message if plugin does not support preserving download data if configured" {
install_dummy_plugin_no_download
@test "install_command prints info message if plugin does not support preserving download data if --keep-download flag is provided" {
run asdf install dummy-no-download 1.0.0 --keep-download
[ "$status" -eq 0 ]
[[ "$output" == *'asdf: Warn:'*'not be preserved'* ]]
}
@test "install_command prints info message if plugin does not support preserving download data if always_keep_download setting is true" {
echo 'always_keep_download = yes' >"$HOME/.asdfrc"
run asdf install dummy-no-download 1.0.0
[ "$status" -eq 0 ]
[[ "$output" == *'asdf: Warn:'*'not be preserved'* ]]
}
@test "install_command does not print info message if --keep-download flag is not provided and always_keep_download setting is false" {
run asdf install dummy-no-download 1.0.0
[ "$status" -eq 0 ]
[[ "$output" != *'asdf: Warn:'*'not be preserved'* ]]
}

View File

@ -1 +1 @@
0.14.0
0.14.1