Skip to content

Commit 811e719

Browse files
committed
Respect dev_port config
1 parent d26d430 commit 811e719

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

run.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,11 @@ import (
44
"fmt"
55
"os"
66
"os/exec"
7+
"strconv"
78
"strings"
89

910
"github.com/code-game-project/go-utils/cgfile"
11+
"github.com/code-game-project/go-utils/config"
1012
"github.com/code-game-project/go-utils/external"
1113
"github.com/code-game-project/go-utils/modules"
1214

@@ -63,6 +65,10 @@ func runClient(url string, args []string) error {
6365
func runServer(args []string) error {
6466
cmdArgs := []string{"run", "."}
6567
cmdArgs = append(cmdArgs, args...)
68+
69+
conf := config.Load()
70+
os.Setenv("CG_PORT", strconv.Itoa(conf.DevPort))
71+
6672
_, err := cgExec.Execute(false, "go", cmdArgs...)
6773
return err
6874
}

0 commit comments

Comments
 (0)