Add mechanism to disable the update command since it will not work when asdf is installed via brew.

This commit is contained in:
Trevor Brown 2017-09-12 18:33:48 -04:00
parent 252ee6a608
commit 84ad80f575

View File

@ -4,6 +4,17 @@ update_command() {
(
cd $(asdf_dir)
if [ -f asdf_updates_disabled ]; then
echo "Update command disabled. Please use the package manager that you used to install asdf to upgrade asdf."
else
do_update "$update_to_head"
fi
)
}
do_update() {
local update_to_head=$1
if [ "$update_to_head" = "--head" ]; then
# Update to latest on the master branch
git checkout master
@ -20,7 +31,6 @@ update_command() {
git checkout "$tag" || exit 1
echo "Updated asdf to release $tag"
fi
)
}
# stolen from https://github.com/rbenv/ruby-build/pull/631/files#diff-fdcfb8a18714b33b07529b7d02b54f1dR942