mirror of
https://github.com/iridakos/goto.git
synced 2025-05-15 23:10:35 -07:00
Check script existence before sourcing
This commit is contained in:
parent
4f47eac606
commit
37f927cd26
2
install
2
install
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user