From: Bastian Dehn Date: Sat, 25 Nov 2017 15:34:03 +0000 (+0100) Subject: change: main function smaller X-Git-Tag: v1.0.0^2~85 X-Git-Url: https://gitweb.hhaalo.de/?a=commitdiff_plain;h=df7d2aa895d26cea3023491938c43c96cc3fff61;p=albentohandy.git change: main function smaller --- diff --git a/albentohandy b/albentohandy index d396107..bd6743d 100755 --- a/albentohandy +++ b/albentohandy @@ -235,21 +235,7 @@ CreateWorkDirectory() { fi } -main() { - WORK="$(pwd)/work.$$" # temporary working directory - SCRIPTPATH="/usr/bin" # path to flactomp3v2 and notify.sh script - MUSICPATH="/tmp/musikpath" # flac collection directory - - ExistsBasicProgramms - LoadConfig - ExistsScripts "$SCRIPTPATH" - SetDefaultVariables - - ReadArguments $* - - ExistsAlbumlist "$albumlist" - CreateWorkDirectory "$WORK" - +ConvertProcess() { printf "\nPhase %02d of %02d:\n" $((curphase++)) $phase printf "create symlinks of flac's in %s\n" "$WORK" MakeSymlinksToWork "$WORK" "$MUSICPATH" "$albumlist" @@ -260,7 +246,9 @@ main() { printf "\nPhase %02d of %02d: " $((curphase++)) $phase printf "remove flac's and cover's\n\n" CleanupFlacAndCovers "$WORK" +} +AdvancedFeatures() { # create sha256sum in working directory if [ $checksum == true ]; then printf "Phase %02d of %02d: " $((curphase++)) $phase @@ -291,6 +279,25 @@ main() { fi } +main() { + WORK="$(pwd)/work.$$" # temporary working directory + SCRIPTPATH="/usr/bin" # path to flactomp3v2 and notify.sh script + MUSICPATH="/tmp/musikpath" # flac collection directory + + ExistsBasicProgramms + LoadConfig + ExistsScripts "$SCRIPTPATH" + SetDefaultVariables + + ReadArguments $* + + ExistsAlbumlist "$albumlist" + CreateWorkDirectory "$WORK" + + ConvertProcess + AdvancedFeatures +} + main $* exit 0