mirror of
https://github.com/xiaoqidun/goenv.git
synced 2024-12-28 16:01:05 +08:00
feat(主机名称): goenv命令添加-h参数映射主机名称
This commit is contained in:
3
goenv.go
3
goenv.go
@ -57,6 +57,9 @@ func (d *DockerGoEnv) Run() {
|
||||
d.CmdArgs = append(d.CmdArgs, "-v", pwd+":"+d.WorkDir, "-w", d.WorkDir)
|
||||
}
|
||||
}
|
||||
if hostname, err1 := os.Hostname(); err1 == nil {
|
||||
d.CmdArgs = append(d.CmdArgs, "-h", hostname)
|
||||
}
|
||||
d.CmdArgs = append(d.CmdArgs, d.Image)
|
||||
cmd := exec.Command(d.Binary, d.CmdArgs...)
|
||||
cmd.Stdin = os.Stdin
|
||||
|
Reference in New Issue
Block a user