Пример #1
0
func Update() error {
	c = nil
	p := cli.BeginProgress("Updating config")
	Set("last-update-check", time.Now().Format(time.RFC3339))
	props := Properties()
	serverURL := props["sous-server"]
	if serverURL == "" {
		p.Done("Failed")
		return fmt.Errorf("sous-server not set; use `sous config sous-server http://your.sous.server`")
	}
	var c *Config
	if err := getJSON(&c, "%s/config", serverURL); err != nil {
		p.Done("Failed")
		return err
	}
	file.WriteJSON(c, "~/.sous/config")
	p.Done("Done")
	return nil
}
Пример #2
0
func (s *BuildState) Commit() {
	if s.path == "" {
		panic("BuildState.path is empty")
	}
	file.WriteJSON(s, s.path)
}
Пример #3
0
func save(c Props) {
	file.WriteJSON(c, propertiesFilePath())
}