From 79a2fd472f3d1c4e2786735a3371e665836fe19e Mon Sep 17 00:00:00 2001 From: Matt Holte Date: Tue, 21 Feb 2023 18:11:21 -0800 Subject: [PATCH] Do not set ASDF_DATA_DIR By default asdf installs tools (ex Ruby) within `$HOME/.asdf`. Overriding that to the directory where Homebrew installs asdf causes Homebrew to clobber existing tool when running `brew update` after a new asdf formula has been released. --- script/bootstrap | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/script/bootstrap b/script/bootstrap index 46ada08..69b7b15 100755 --- a/script/bootstrap +++ b/script/bootstrap @@ -119,14 +119,14 @@ else fi echo "==> Injecting asdf into PATH" -ASDF_DATA_DIR=`brew --prefix asdf` +# shellcheck disable=SC2016 +ASDF_CONFIG_LINE='source $(brew --prefix asdf)/libexec/asdf.sh' -if grep -Fq "$ASDF_DATA_DIR" $SHELL_CONFIG +if grep -Fq "$ASDF_CONFIG_LINE" "$SHELL_CONFIG" then echo " Already found asdf in path. Skipping." else - echo "export ASDF_DATA_DIR=$ASDF_DATA_DIR" >> $SHELL_CONFIG - echo 'source $ASDF_DATA_DIR/libexec/asdf.sh' >> $SHELL_CONFIG + echo "$ASDF_CONFIG_LINE" >> "$SHELL_CONFIG" echo fi source $SHELL_CONFIG