blob: ae1ceac4e6f04e6a3175f3e87a8c8ac71a1b0a44 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
|
// Copyright 2017-2025 WIT.COM Inc. All rights reserved.
// Use of this source code is governed by the GPL 3.0
package main
import (
"go.wit.com/gui"
"go.wit.com/lib/protobuf/gitpb"
"go.wit.com/log"
)
// callback for bash autocomplete to shutdown
// forge properly before exiting back to the shell
// hopefully will allow the GUI plugins to unload properly
func (args) Exit() {
forgeShutdown()
}
func forgeShutdown() {
gui.UnloadToolkits()
resetTerminalTitle()
log.Info("exit got to forgeShutdown()")
// me.forge.SetConfigSave(configSave)
if err := me.forge.Close(); err != nil {
log.Info("ABNORMAL END", err)
}
}
func okExit(thing string) {
me.sh.GoodExit(thing)
}
func badExit(err error) {
me.sh.BadExit("forge failed", err)
}
func newBadExit(msg string, err error) {
me.sh.BadExit(msg, err)
}
func badRepoExit(repo *gitpb.Repo, err error) {
s := log.Sprintf("%s FAILED: %v", repo.GetNamespace(), err)
me.sh.BadExit(s, err)
}
|