switched order. delete before upload

This commit is contained in:
Philipp Häfelfinger 2019-03-25 23:40:28 +01:00
parent f2d83e57ea
commit 86e26b1bb5

View File

@ -58,22 +58,22 @@ func Run() {
logErrorAndExit(err, 7) logErrorAndExit(err, 7)
} }
if !(*noUpload) { if *removeImages {
err = uploadImages(context.piwigo, context.dataStore) err = deleteImages(context.piwigo, context.dataStore)
if err != nil { if err != nil {
logErrorAndExit(err, 8) logErrorAndExit(err, 8)
} }
} else { } else {
logrus.Warnln("Skipping upload of images as flag noUpload is set to true!") logrus.Info("The flag removeImages is disabled. Skipping...")
} }
if *removeImages { if !(*noUpload) {
err = deleteImages(context.piwigo, context.dataStore) err = uploadImages(context.piwigo, context.dataStore)
if err != nil { if err != nil {
logErrorAndExit(err, 9) logErrorAndExit(err, 9)
} }
} else { } 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() _ = context.piwigo.Logout()