From df7d2aa895d26cea3023491938c43c96cc3fff61 Mon Sep 17 00:00:00 2001 From: Bastian Dehn Date: Sat, 25 Nov 2017 16:34:03 +0100 Subject: [PATCH] change: main function smaller --- albentohandy | 37 ++++++++++++++++++++++--------------- 1 file changed, 22 insertions(+), 15 deletions(-) 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 -- 2.47.3