1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2024-09-29 23:36:25 -04:00
v2fly/testing/scenarios/server_env_regular.go
2016-08-09 00:55:36 +02:00

30 lines
493 B
Go

// +build !coverage
package scenarios
import (
"os"
"os/exec"
)
func BuildV2Ray() error {
if _, err := os.Stat(binaryPath); err == nil {
return nil
}
if err := FillBinaryPath(); err != nil {
return err
}
cmd := exec.Command("go", "build", "-tags=json", "-o="+binaryPath, GetSourcePath())
return cmd.Run()
}
func RunV2Ray(configFile string) *exec.Cmd {
proc := exec.Command(binaryPath, "-config="+configFile)
proc.Stderr = os.Stderr
proc.Stdout = os.Stdout
return proc
}