Files
mc-tool/server/start.go

26 lines
362 B
Go

package server
import (
"log"
"os"
"os/exec"
"github.com/spf13/cobra"
)
func Start(cmd *cobra.Command, args []string) {
dir := "."
if len(args) > 0 {
dir = args[0]
}
if err := os.Chdir(dir); err != nil {
log.Fatal(err)
}
start_cmd := exec.Command("docker", "compose", "up", "-d")
if err := start_cmd.Run(); err != nil {
log.Fatal(err)
}
}