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 }
func (s *BuildState) Commit() { if s.path == "" { panic("BuildState.path is empty") } file.WriteJSON(s, s.path) }
func save(c Props) { file.WriteJSON(c, propertiesFilePath()) }