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) } }
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() }
// BaseDir return the build state base directory for the current target. func (c *Context) BaseDir() string { return path.BaseDir(c.BuildState.path) }