12345678910111213141516171819202122232425262728293031 |
- // The Isomorphic Go Project
- // Copyright (c) Wirecog, LLC. All rights reserved.
- // Use of this source code is governed by a BSD-style
- // license, which can be found in the LICENSE file.
-
- // +build !windows
-
- package main
-
- import (
- "os"
- "os/exec"
- "syscall"
- )
-
- func start() *exec.Cmd {
- buildGopherJSProject()
- cmd := exec.Command("go", "run", appPath+"/"+mainSourceFile)
- cmd.SysProcAttr = &syscall.SysProcAttr{Setpgid: true}
- cmd.Stdout = os.Stdout
- cmd.Stderr = os.Stderr
- cmd.Start()
- return cmd
- }
-
- func stop(cmd *exec.Cmd) {
- pgid, err := syscall.Getpgid(cmd.Process.Pid)
- if err == nil {
- syscall.Kill(-pgid, 15)
- }
- }
|