From: Bastian Dehn Date: Sun, 13 Jul 2025 18:07:48 +0000 (+0200) Subject: optimize load config file X-Git-Tag: v1.0.0^2~53^2~14 X-Git-Url: https://gitweb.hhaalo.de/?a=commitdiff_plain;h=92c0860dfb9c4c130936093d9aa87b1108a120ba;p=albentohandy.git optimize load config file --- diff --git a/albentohandy b/albentohandy index a414ff8..8b88e6b 100755 --- a/albentohandy +++ b/albentohandy @@ -346,13 +346,11 @@ CopyWorkDirToDestDir() cp --recursive $WORKDIR/* $DESTDIR } -LoadConfig() +load_config() { - # .albentohandy.conf: set MUSICPATH - if [ ! -f "$HOME/.albentohandy.conf" ]; then - echo "ERROR: $HOME/.albentohandy.conf does not exists" - exit 1 - fi + [ -f "$HOME/.albentohandy.conf" ] \ + || errlog "file $HOME/.albentohandy.conf does not exists" \ + || return $? source $HOME/.albentohandy.conf } @@ -505,7 +503,7 @@ main() MUSICPATH="/tmp/musikpath" # flac collection directory check_programms || return $? - LoadConfig + load_config || return $? SetDefaultVariables ReadArguments $*