From a50e7eb94b84f529c6c552240cf17e22e9074778 Mon Sep 17 00:00:00 2001 From: Chris Kim <1074881+dy-dx@users.noreply.github.com> Date: Sun, 31 Mar 2024 20:19:25 -0400 Subject: [PATCH] ensure leading newline when adding lines to shell profile (#197) --- 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"