mirror of
https://github.com/asdf-vm/asdf.git
synced 2024-11-15 01:28:17 -07:00
fix!: 0 exit code for success when adding an existing plugin (#1598)
This commit is contained in:
parent
d1a563dcc0
commit
4dd190466a
@ -79,8 +79,8 @@ plugin_add_command() {
|
||||
mkdir -p "$(asdf_data_dir)/plugins"
|
||||
|
||||
if [ -d "$plugin_path" ]; then
|
||||
display_error "Plugin named $plugin_name already added"
|
||||
exit 2
|
||||
printf '%s\n' "Plugin named $plugin_name already added"
|
||||
exit 0
|
||||
else
|
||||
asdf_run_hook "pre_asdf_plugin_add" "$plugin_name"
|
||||
asdf_run_hook "pre_asdf_plugin_add_${plugin_name}"
|
||||
|
@ -97,12 +97,12 @@ teardown() {
|
||||
[ "$output" = "dummy" ]
|
||||
}
|
||||
|
||||
@test "plugin_add command with URL specified run twice returns error second time" {
|
||||
@test "plugin_add command with URL specified twice returns success on second time" {
|
||||
install_mock_plugin_repo "dummy"
|
||||
|
||||
run asdf plugin add "dummy" "${BASE_DIR}/repo-dummy"
|
||||
run asdf plugin add "dummy" "${BASE_DIR}/repo-dummy"
|
||||
[ "$status" -eq 2 ]
|
||||
[ "$status" -eq 0 ]
|
||||
[ "$output" = "Plugin named dummy already added" ]
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user