switched order. delete before upload
This commit is contained in:
parent
f2d83e57ea
commit
86e26b1bb5
@ -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()
|
||||||
|
Loading…
Reference in New Issue
Block a user