setup.py 436 B

123456789101112131415161718
  1. import subprocess
  2. import sys
  3. import os
  4. def start(args):
  5. subprocess.call("go get ./...", shell=True, cwd="webgo")
  6. subprocess.Popen("go run src/hello/hello.go".rsplit(" "), cwd="webgo")
  7. return 0
  8. def stop():
  9. p = subprocess.Popen(['ps', 'aux'], stdout=subprocess.PIPE)
  10. out, err = p.communicate()
  11. for line in out.splitlines():
  12. if 'hello' in line:
  13. pid = int(line.split(None, 2)[1])
  14. os.kill(pid, 9)
  15. return 0