sourcing already tests if file exists

This commit is contained in:
James Barnett 2017-02-14 13:13:56 -06:00
parent 29be92e46a
commit 89db1fcfe7
No known key found for this signature in database
GPG key ID: E4B5E45AA3B8C5C3

View file

@ -33,7 +33,7 @@ die() {
[[ $PACMAN_ABORT_ON_FAIL == "no" ]] && exit 0
exit 1
}
error_exit() { die "Encountered unknown error."; }
error_exit() { die "Aborted due to error."; }
kill_exit() { die "\nExited due to user intervention."; }
truncate_description() {
@ -48,7 +48,6 @@ truncate_description() {
trap error_exit ERR
trap kill_exit SIGTERM SIGINT
[[ ! -f "$SNAPPER_CONFIG_FILE" ]] && die "%s does not exist." "$SNAPPER_CONFIG_FILE"
source "$SNAPPER_CONFIG_FILE"
[[ $EUID -ne 0 ]] && die "Script must be run as root."