forgepb/sampleConfig.go

64 lines
1.3 KiB
Go

package forgepb
import (
"fmt"
"go.wit.com/log"
)
func (all *Repos) SampleConfig() {
new1 := new(Repo)
new1.GoPath = "go.wit.com"
new1.Writable = true
new1.Directory = true
if all.Append(new1) {
log.Info("added", new1.GoPath, "ok")
} else {
log.Info("added", new1.GoPath, "failed")
}
new1 = new(Repo)
new1.GoPath = "go.wit.com/apps/zookeeper"
new1.DebName = "zookeeper-go"
if all.Append(new1) {
log.Info("added", new1.GoPath, "ok")
} else {
log.Info("added", new1.GoPath, "failed")
}
new1 = new(Repo)
new1.GoPath = "go.wit.com/apps/wit-package"
new1.Private = true
if all.Append(new1) {
log.Info("added", new1.GoPath, "ok")
} else {
log.Info("added", new1.GoPath, "failed")
}
new1 = new(Repo)
new1.GoPath = "go.wit.com/apps/networkQuality"
new1.DebName = "networkquality"
new1.ReadOnly = true
if all.Append(new1) {
log.Info("added", new1.GoPath, "ok")
} else {
log.Info("added", new1.GoPath, "failed")
}
new2 := new(Repo)
new2.GoPath = "go.wit.com/apps/go-clone"
if all.Append(new2) {
log.Info("added", new2.GoPath, "ok")
} else {
log.Info("added", new2.GoPath, "failed")
}
if all.Append(new2) {
log.Info("added", new2.GoPath, "ok (this is bad)")
} else {
log.Info("added", new2.GoPath, "failed (but ok)")
}
fmt.Println("first time user. adding an example config file with", len(all.Repos), "repos")
}