restructure to build individual binaries

This commit is contained in:
Michael Hobbs committed 2017-03-20 09:16:49 -07:00
1 parent e61475c7ea
commit fc31b28ab6
8 files changed
+30 -43

No files matched your search

+29
View File
@@ -0,0 +1,29 @@
package main
import (
"flag"
"strings"
common "github.com/dokku/dokku/plugins/common"
)
// runs 'git gc --aggressive' against the application's repo
func main() {
flag.Parse()
appName := flag.Arg(1)
if appName == "" {
common.LogFail("Please specify an app to run the command on")
}
err := common.VerifyAppName(appName)
if err != nil {
common.LogFail(err.Error())
}
appRoot := strings.Join([]string{common.MustGetEnv("DOKKU_ROOT"), appName}, "/")
cmdEnv := map[string]string{
"GIT_DIR": appRoot,
}
gitGcCmd := common.NewDokkuCmd("git gc --aggressive")
gitGcCmd.Env = cmdEnv
gitGcCmd.Execute()
}