Exemplo n.º 1
0
func prepareDir(c config.CodeResourceOperator, path string) error {
	fullPath := filepath.Join(path, c.DesticationPath())
	fmt.Printf("create %v\n", fullPath)

	err := os.MkdirAll(fullPath, 0744)
	if err != nil {
		return err
	}
	return nil
}
Exemplo n.º 2
0
func copyRecipes(c config.CodeResourceOperator, path string) error {
	if err := prepareDir(c, path); err != nil {
		return err
	}
	destDir := filepath.Join(path, c.DesticationPath())
	srcDir := filepath.Join(c.CacheRepoPath(), c.SourcePath())
	fmt.Printf(" -- copy %s to %s\n", srcDir, destDir)
	cmd := exec.Command("cp", "-rf", srcDir+"/", destDir)
	if err := cmd.Run(); err != nil {
		return err
	}
	return nil
}