Example #1
0
func setAndRestartCmd() {
	s, err := parseInstallRequest()
	kmgConsole.ExitOnStderr(err)
	err = Install(s)
	if err != nil {
		if err != ErrServiceExist {
			kmgConsole.ExitOnStderr(err)
		}
		err = Uninstall(s.Name)
		kmgConsole.ExitOnStderr(err)
		err = Install(s)
		kmgConsole.ExitOnStderr(err)
	}
	err = Restart(s.Name)
	kmgConsole.ExitOnStderr(err)
}
Example #2
0
func makeCmd() {
	kmgc, err := kmgConfig.LoadEnvFromWd()
	kmgConsole.ExitOnErr(err)
	if kmgc.Make == "" {
		kmgConsole.ExitOnStderr(errors.New("Please defined a Make command in .kmg.yml file to use kmg make"))
		return
	}
	if len(os.Args) >= 2 && kmgc.MakeSubCommandMap != nil {
		for cmdName, cmdString := range kmgc.MakeSubCommandMap {
			if strings.EqualFold(cmdName, os.Args[1]) {
				args := strings.Split(cmdString, " ")
				os.Args = os.Args[1:]
				runCommand(kmgc, args)
				return
			}
		}
	}
	args := strings.Split(kmgc.Make, " ")
	runCommand(kmgc, args)
}
Example #3
0
func installCmd() {
	s, err := parseInstallRequest()
	kmgConsole.ExitOnStderr(err)
	err = Install(s)
	kmgConsole.ExitOnStderr(err)
}