From 92c0860dfb9c4c130936093d9aa87b1108a120ba Mon Sep 17 00:00:00 2001 From: Bastian Dehn Date: Sun, 13 Jul 2025 20:07:48 +0200 Subject: [PATCH] optimize load config file --- albentohandy | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) 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 $* -- 2.47.3