PackageManager just because
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

36 lines
776 B

package Package
import (
yaml "gopkg.in/yaml.v2"
)
type Manifest struct {
Name string `yaml:"name"`
Version string `yaml:"version"`
Symlinks map[string]string `yaml:"symlinks,flow"`
Dependancies map[string]string `yaml:"dependancies,flow"`
PreInstallCmds []string `yaml:"pre_install_cmds"`
PostInstallCmds []string `yaml:"post_install_cmds"`
}
func ParseManifestFile(manifest string) (Manifest, error) {
var (
m Manifest = Manifest{}
e error
)
e = yaml.Unmarshal([]byte(manifest), &m)
return m, e
}
func (m Manifest) CreateManifestString() (string, error) {
var (
mByte []byte
e error
)
mByte, e = yaml.Marshal(&m)
if e != nil {
return "", e
}
return string(mByte), e
}