updated kfg to install ghostty integration correctly - fixed

This commit is contained in:
Christopher Beckmann
2025-01-10 12:42:49 +01:00
parent 04243284a1
commit 1f896e3bb5

12
kfg
View File

@@ -190,17 +190,13 @@ function prepend_rc {
# Add the file to the rc file as source $file # Add the file to the rc file as source $file
SOURCE_CMD="$1" SOURCE_CMD="$1"
RC="$HOME_PATH/$RC_FILE" RC="$HOME_PATH/$RC_FILE"
case `grep -Fox "${SOURCE_CMD}" "$RC"> /dev/null; echo $?` in local out=`grep -Fox "${SOURCE_CMD}" "$RC"`
1) if [ -z "$out" ]; then
sed -i "1i${SOURCE_CMD//$'\n'/\\n}" "$RC" sed -i "1i${SOURCE_CMD//$'\n'/\\n}" "$RC"
log_add "Added \"$SOURCE_CMD\" to $RC" log_add "Added \"$SOURCE_CMD\" to $RC"
;; else
0)
log_debug "\"$SOURCE_CMD\" already in $RC" log_debug "\"$SOURCE_CMD\" already in $RC"
;; fi
*)
log_error "Error occured trying to add $SOURCE_CMD to $RC"
esac
} }
function download { function download {