From 6d974370116f2e58a7e6afe0d7df37c24506f8f9 Mon Sep 17 00:00:00 2001 From: Chris Kim Date: Fri, 29 Mar 2024 13:17:41 -0400 Subject: [PATCH] ensure leading newline when adding lines to shell profile --- install.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/install.sh b/install.sh index c812667..35cd5aa 100755 --- a/install.sh +++ b/install.sh @@ -53,8 +53,9 @@ case $SHELL in esac if [ ! $DVM_DIR ];then - command echo "export DVM_DIR=\"$dvm_dir\"" >> "$HOME/$shell_profile" - command echo "export PATH=\"\$DVM_DIR/bin:\$PATH\"" >> "$HOME/$shell_profile" + EXPORT_DVM_DIR="export DVM_DIR=\"$dvm_dir\"" + EXPORT_PATH="export PATH=\"\$DVM_DIR/bin:\$PATH\"" + command printf "\\n$EXPORT_DVM_DIR\\n$EXPORT_PATH\\n" >> "$HOME/$shell_profile" fi echo "Dvm was installed successfully to $exe"