rename DokkuCmd to ShellCmd and use strings.Join instead of fmt.Sprintf

This commit is contained in:
Michael Hobbs
2017-01-17 11:12:38 -08:00
parent 177b45c49b
commit f0efdd2ed4
3 changed files with 9 additions and 9 deletions

View File

@@ -23,7 +23,7 @@ func main() {
cmdEnv := map[string]string{
"GIT_DIR": appRoot,
}
gitGcCmd := common.NewDokkuCmd("git gc --aggressive")
gitGcCmd := common.NewShellCmd("git gc --aggressive")
gitGcCmd.Env = cmdEnv
gitGcCmd.Execute()
}

View File

@@ -24,7 +24,7 @@ func main() {
dokkuGlobalRunArgs := common.MustGetEnv("DOKKU_GLOBAL_RUN_ARGS")
image := common.GetDeployingAppImageName(appName, "", "")
if info, _ := os.Stat(cacheDir); info != nil && info.IsDir() {
purgeCacheCmd := common.NewDokkuCmd(strings.Join([]string{"docker run --rm", dokkuGlobalRunArgs,
purgeCacheCmd := common.NewShellCmd(strings.Join([]string{"docker run --rm", dokkuGlobalRunArgs,
"-v", strings.Join([]string{cacheDir, ":/cache"}, ""), image,
`find /cache -depth -mindepth 1 -maxdepth 1 -exec rm -Rf {} ;`}, " "))
purgeCacheCmd.Execute()