32 lines
663 B
Go
32 lines
663 B
Go
package main
|
|
|
|
// functions to import and export the protobuf
|
|
// data to and from config files
|
|
|
|
import (
|
|
"fmt"
|
|
|
|
"go.wit.com/lib/config"
|
|
"go.wit.com/lib/protobuf/forgepb"
|
|
)
|
|
|
|
func forgeConfigSave() error {
|
|
return me.forge.Config.ConfigSave()
|
|
}
|
|
|
|
func setForgeMode(fmode forgepb.ForgeMode) {
|
|
me.forge.Config.Mode = fmode
|
|
config.SetChanged("forge", true)
|
|
me.forge.Config.ConfigSave()
|
|
}
|
|
|
|
func sampleConfig(all *forgepb.ForgeConfigs) {
|
|
new1 := new(forgepb.ForgeConfig)
|
|
new1.GoPath = "go.wit.com"
|
|
new1.Writable = true
|
|
new1.Directory = true
|
|
all.Append(new1)
|
|
|
|
fmt.Println("first time user. adding an example config file with", len(all.ForgeConfigs), "repos")
|
|
}
|