diff options
| -rw-r--r-- | syz-ci/syz-ci.go | 2 | ||||
| -rw-r--r-- | syz-ci/updater.go | 4 |
2 files changed, 6 insertions, 0 deletions
diff --git a/syz-ci/syz-ci.go b/syz-ci/syz-ci.go index 00035a6ce..e1408c64e 100644 --- a/syz-ci/syz-ci.go +++ b/syz-ci/syz-ci.go @@ -79,6 +79,8 @@ var ( flagAutoUpdate = flag.Bool("autoupdate", true, "auto-update the binary (for testing)") flagManagers = flag.Bool("managers", true, "start managers (for testing)") flagDebug = flag.Bool("debug", false, "debug mode (for testing)") + // nolint: lll + flagExitOnUpgrade = flag.Bool("exit-on-upgrade", false, "exit after a syz-ci upgrade is applied; otherwise syz-ci restarts") ) type Config struct { diff --git a/syz-ci/updater.go b/syz-ci/updater.go index 9bced556a..d232451b4 100644 --- a/syz-ci/updater.go +++ b/syz-ci/updater.go @@ -194,6 +194,10 @@ func (upd *SyzUpdater) UpdateAndRestart() { if err := osutil.CopyFile(latestBin, upd.exe); err != nil { log.Fatal(err) } + if *flagExitOnUpgrade { + log.Logf(0, "exiting, please restart syz-ci to run the new version") + os.Exit(0) + } if err := syscall.Exec(upd.exe, os.Args, os.Environ()); err != nil { log.Fatal(err) } |
