From b86601cccb50699f2ca43d2580880b170091b380 Mon Sep 17 00:00:00 2001 From: velvettear Date: Fri, 22 Sep 2023 10:58:33 +0200 Subject: [PATCH] exit when no files were found --- tools/rsync.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tools/rsync.go b/tools/rsync.go index 527f0b6..fe0171f 100644 --- a/tools/rsync.go +++ b/tools/rsync.go @@ -24,6 +24,10 @@ func Transfer() { transferSize = 0 sourcefiles := getSourceFiles() sourcefilesCount := len(sourcefiles) + if sourcefilesCount <= 0 { + log.Info("nothing to do - exiting...") + os.Exit(0) + } var waitgroup sync.WaitGroup waitgroup.Add(sourcefilesCount) barcontainer := mpb.New(