Skip to content

Commit 597425e

Browse files
author
echoVic
committed
fix: close Web UI when wrapped command exits
1 parent 88c26c4 commit 597425e

5 files changed

Lines changed: 1 addition & 9 deletions

File tree

cmd/bar/wrap.go

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -165,17 +165,9 @@ When the command exits, BAR records a step with the diff of all changes.`,
165165
app.Logger.Info("Step %s recorded", stepID)
166166
app.Logger.Info("Files changed: %d (+%d, -%d)", diffResult.Files, diffResult.Additions, diffResult.Deletions)
167167

168-
// If UI is running, wait for user to close it
168+
// Stop UI server if running
169169
if uiServer != nil {
170-
app.Logger.Info("")
171-
app.Logger.Info("Web UI still running. Press Ctrl+C to exit.")
172-
173-
waitChan := make(chan os.Signal, 1)
174-
signal.Notify(waitChan, syscall.SIGINT, syscall.SIGTERM)
175-
<-waitChan
176-
177170
uiServer.Stop()
178-
app.Logger.Info("Web UI stopped.")
179171
}
180172

181173
return nil

dist/bar_darwin_amd64.tar.gz

498 Bytes
Binary file not shown.

dist/bar_darwin_arm64.tar.gz

349 Bytes
Binary file not shown.

dist/bar_linux_amd64.tar.gz

-1.42 KB
Binary file not shown.

dist/bar_linux_arm64.tar.gz

275 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)