Example #1
0
func (smg *SousManifestSet) Execute(args []string) cmdr.Result {
	mid := sous.ManifestID(smg.TargetManifestID)

	_, present := smg.State.Manifests.Get(mid)
	if !present {
		return EnsureErrorResult(errors.Errorf("No manifest matched by %v yet. See `sous init`", smg.ResolveFilter))
	}

	yml := sous.Manifest{}
	bytes, err := ioutil.ReadAll(smg.InReader)
	if err != nil {
		return EnsureErrorResult(err)
	}
	err = yaml.Unmarshal(bytes, &yml)
	if err != nil {
		return EnsureErrorResult(err)
	}
	smg.State.Manifests.Set(mid, &yml)
	err = smg.StateWriter.WriteState(smg.State)
	if err != nil {
		return EnsureErrorResult(err)
	}

	return Success()
}
Example #2
0
func Unmarshal(in []byte, out interface{}) error {
	return y.Unmarshal(in, out, y.OPT_NOLOWERCASE)
}