]> gitweb.hhaalo.de Git - albentohandy.git/commitdiff
change: main function smaller
authorBastian Dehn <hhaalo@arcor.de>
Sat, 25 Nov 2017 15:34:03 +0000 (16:34 +0100)
committerBastian Dehn <hhaalo@arcor.de>
Sat, 25 Nov 2017 15:34:03 +0000 (16:34 +0100)
albentohandy

index d3961078ffec35b3e1d8a94ee470136ca4a97209..bd6743d77c0d2f6ca6e4feb3ce6b3f495f107acc 100755 (executable)
@@ -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