Check if system-wide config exists before sourcing

When /etc/rofi-pass.conf did not exist, rofi-pass would spit out an
error message to the console.
Better check for the file's existence before sourcing.
This commit is contained in:
Gordon Schulz 2015-08-23 14:12:43 +02:00
parent 93241ba424
commit c18711e7aa

View File

@ -6,8 +6,10 @@
# enable extended globbing
shopt -s nullglob globstar
# read global config file
source /etc/rofi-pass.conf
# check if global config exists and load it
if [[ -f /etc/rofi-pass.conf ]]; then
source /etc/rofi-pass.conf
fi
# check if local config exists and load it
if [[ -f $HOME/.config/rofi-pass/config ]]; then