Skip to content

Commit

Permalink
Respect dev_port config
Browse files Browse the repository at this point in the history
  • Loading branch information
juho05 committed Dec 9, 2022
1 parent d26d430 commit 811e719
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions run.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,11 @@ import (
"fmt"
"os"
"os/exec"
"strconv"
"strings"

"github.com/code-game-project/go-utils/cgfile"
"github.com/code-game-project/go-utils/config"
"github.com/code-game-project/go-utils/external"
"github.com/code-game-project/go-utils/modules"

Expand Down Expand Up @@ -63,6 +65,10 @@ func runClient(url string, args []string) error {
func runServer(args []string) error {
cmdArgs := []string{"run", "."}
cmdArgs = append(cmdArgs, args...)

conf := config.Load()
os.Setenv("CG_PORT", strconv.Itoa(conf.DevPort))

_, err := cgExec.Execute(false, "go", cmdArgs...)
return err
}

0 comments on commit 811e719

Please sign in to comment.