diff options
-rw-r--r-- | src/qtmoduleupdater/main.go | 4 | ||||
-rw-r--r-- | src/qtmoduleupdater/moduleupdatebatch.go | 4 |
2 files changed, 6 insertions, 2 deletions
diff --git a/src/qtmoduleupdater/main.go b/src/qtmoduleupdater/main.go index 5ef5d0d..709476d 100644 --- a/src/qtmoduleupdater/main.go +++ b/src/qtmoduleupdater/main.go @@ -123,14 +123,14 @@ func appMain() error { return err } } else { - os.Remove("state.json") - if batch.FailedModuleCount == 0 { fmt.Println("Preparing qt5 update") if err = prepareQt5Update(product, batch.Branch, batch.Done, pushUserName, manualStage); err != nil { return fmt.Errorf("error preparing qt5 update: %s", err) } } + + batch.clearState() } return nil diff --git a/src/qtmoduleupdater/moduleupdatebatch.go b/src/qtmoduleupdater/moduleupdatebatch.go index 6eabde0..11b73f4 100644 --- a/src/qtmoduleupdater/moduleupdatebatch.go +++ b/src/qtmoduleupdater/moduleupdatebatch.go @@ -198,6 +198,10 @@ func (batch *ModuleUpdateBatch) loadState() error { return nil } +func (batch *ModuleUpdateBatch) clearState() { + os.Remove(batch.stateFileName()) +} + func (batch *ModuleUpdateBatch) isDone() bool { return len(batch.Todo) == 0 && len(batch.Pending) == 0 } |