From 86e26b1bb55991c12b09c77085bed5beff92151c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philipp=20H=C3=A4felfinger?= Date: Mon, 25 Mar 2019 23:40:28 +0100 Subject: [PATCH] switched order. delete before upload --- internal/app/app.go | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/internal/app/app.go b/internal/app/app.go index 94c735e..9958e07 100644 --- a/internal/app/app.go +++ b/internal/app/app.go @@ -58,22 +58,22 @@ func Run() { logErrorAndExit(err, 7) } - if !(*noUpload) { - err = uploadImages(context.piwigo, context.dataStore) + if *removeImages { + err = deleteImages(context.piwigo, context.dataStore) if err != nil { logErrorAndExit(err, 8) } } else { - logrus.Warnln("Skipping upload of images as flag noUpload is set to true!") + logrus.Info("The flag removeImages is disabled. Skipping...") } - if *removeImages { - err = deleteImages(context.piwigo, context.dataStore) + if !(*noUpload) { + err = uploadImages(context.piwigo, context.dataStore) if err != nil { logErrorAndExit(err, 9) } } else { - logrus.Info("The flag removeImages is disabled. Skipping...") + logrus.Warnln("Skipping upload of images as flag noUpload is set to true!") } _ = context.piwigo.Logout()