Move duplicate warning before registration message.

This commit is contained in:
Lazarus Lazaridis 2018-03-12 06:45:19 +02:00
parent 51f8c88eba
commit 12336713a0

View File

@ -148,15 +148,13 @@ function _goto_register_alias()
local duplicate
duplicate=$(_goto_find_duplicate "$directory")
if [ -n "$duplicate" ]; then
_goto_warning "duplicate alias(es) found: \\n$duplicate"
fi
# Append entry to file.
echo "$1 $directory" >> "$GOTO_DB"
echo "Alias '$1' registered successfully."
if [ -n "$duplicate" ]; then
echo -e "note: duplicate alias found:\n$duplicate"
return
fi
}
# Unregisters the given alias.