mirror of
https://github.com/asdf-vm/asdf.git
synced 2024-11-15 01:28:17 -07:00
plugin-add: argument validation
This commit is contained in:
parent
1589a03678
commit
f9572739f6
@ -1,4 +1,9 @@
|
||||
plugin_add_command() {
|
||||
if [ "$#" -ne 2 ]; then
|
||||
display_error "usage: asdf plugin-add <name> <git-url>"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
local plugin_name=$1
|
||||
local source_url=$2
|
||||
local plugin_path=$(get_plugin_path $plugin_name)
|
||||
@ -6,7 +11,7 @@ plugin_add_command() {
|
||||
mkdir -p $(asdf_dir)/plugins
|
||||
|
||||
if [ -d $plugin_path ]; then
|
||||
echo "Plugin named $plugin_name already added"
|
||||
display_error "Plugin named $plugin_name already added"
|
||||
exit 1
|
||||
else
|
||||
git clone $source_url $plugin_path
|
||||
|
Loading…
Reference in New Issue
Block a user