In standalone mode, mender command exits with code 2 when running mender -commit
when there is nothing to commit.
Under mender 2.0, the exit 2 is still there but the code block is unreachable.
Below is a quick and dirty patch to restore the behavior:
diff --git a/standalone.go b/standalone.go
index e54d1c6..6320cfb 100644
--- a/standalone.go
+++ b/standalone.go
@@ -538,7 +538,7 @@ func handlePreDatabaseRestore(device *deviceManager) (*standaloneData, error) {
// VerifyReboot() is what would be used to verify we have rebooted into
// a new update.
if !ok || dualRootfs.VerifyReboot() != nil {
- return nil, errors.New("No artifact installation in progress")
+ return nil, installer.ErrorNothingToCommit
}
// Forcibly sidestep the database for artifact name query and fetch it