rename DokkuCmd to ShellCmd and use strings.Join instead of fmt.Sprintf
This commit is contained in:
@@ -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()
|
||||
}
|
||||
|
||||
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user