Check script existence before sourcing

This commit is contained in:
Lazarus Lazaridis 2018-03-12 08:26:19 +02:00
parent 4f47eac606
commit 37f927cd26

View File

@ -50,7 +50,7 @@ if [ -n "$RC" ]; then
# Append source to RC startup file if not already there
if [ "$(grep -c "source $GOTO_FILE_LOCATION" "$RC")" == "0" ]; then
# Append source to RC file
echo -e "\\n#Source goto\\nsource $GOTO_FILE_LOCATION\\n" >> "$RC"
echo -e "\\n\\n# Source goto\\n[[ -s \"$GOTO_FILE_LOCATION\" ]] && source $GOTO_FILE_LOCATION\\n" >> "$RC"
fi
# shellcheck source=/dev/null