Inital commit
This commit is contained in:
21
server/restart.go
Normal file
21
server/restart.go
Normal file
@@ -0,0 +1,21 @@
|
||||
package server
|
||||
|
||||
import (
|
||||
"log"
|
||||
"os"
|
||||
"os/exec"
|
||||
|
||||
"github.com/spf13/cobra"
|
||||
)
|
||||
|
||||
func Restart(cmd *cobra.Command, args []string) {
|
||||
dir := args[0]
|
||||
if err := os.Chdir(dir); err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
|
||||
start_cmd := exec.Command("docker", "compose", "restart")
|
||||
if err := start_cmd.Run(); err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user