blob: c11fb22d0b646fe0c134bbffcc4f329d90b6ebb7 (
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
45
46
47
48
49
50
51
52
53
|
// Copyright 2017-2025 WIT.COM Inc. All rights reserved.
// Use of this source code is governed by the GPL 3.0
package main
import (
"sync"
"go.wit.com/lib/gui/prep"
"go.wit.com/lib/protobuf/forgepb"
"go.wit.com/lib/protobuf/gitpb"
"go.wit.com/lib/protobuf/zoopb"
)
var me *mainType
// this app's variables
type mainType struct {
once sync.Once // one-time initialized data
auto *prep.Auto // more experiments for bash handling
forge *forgepb.Forge // your customized repo preferences and settings
machine *zoopb.Machine // your customized repo preferences and settings
}
// move these to mainType
var failed map[*gitpb.Repo]string
var state map[*gitpb.Repo]string
var debnames map[*gitpb.Repo]string
func initForge() {
if me.forge == nil {
me.forge = forgepb.Init()
me.forge.Config.DumpENV()
}
initMachine()
}
func initMachine() {
if me.machine == nil {
me.machine, _ = zoopb.InitMachine()
}
}
func initMain() {
// autocomplete must be processed before there is anything sent to STDOUT or STDERR
me.auto = prep.Bash3(&argv) // add support for bash autocomplete with go-arg
failed = make(map[*gitpb.Repo]string)
state = make(map[*gitpb.Repo]string)
debnames = make(map[*gitpb.Repo]string)
dumpDebug()
}
|