示例#1
0
文件: file.go 项目: liamjbennett/sous
func Write(data []byte, pathFormat string, a ...interface{}) {
	p := path.Resolve(pathFormat, a...)
	dir.EnsureExists(path.BaseDir(p))
	err := ioutil.WriteFile(p, data, 0777)
	if err != nil {
		cli.Fatalf("unable to write file %s; %s", p, err)
	}
}
示例#2
0
func BuildPath(sous *core.Sous, args []string) {
	target := "app"
	if len(args) != 0 {
		target = args[0]
	}
	_, context := sous.AssembleTargetContext(target)
	fmt.Println(path.Resolve(path.BaseDir(context.BaseDir())))
	cli.Success()
}
示例#3
0
// BaseDir return the build state base directory for the current target.
func (c *Context) BaseDir() string {
	return path.BaseDir(c.BuildState.path)
}