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
1 changed files with 6 additions and 6 deletions

View File

@ -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()