setup_erlang.py 662 B

123456789101112131415161718192021
  1. import subprocess
  2. import sys
  3. import setup_util
  4. def start(args):
  5. # setup_util.replace_text("rails/config/database-ruby.yml", "host: .*", "host: " + args.database_host)
  6. try:
  7. subprocess.check_call("./rebar get-deps", shell=True, cwd="cowboy")
  8. subprocess.check_call("./rebar compile", shell=True, cwd="cowboy")
  9. subprocess.check_call("erl -pa ebin deps/*/ebin -s hello_world -noshell -detached", shell=True, cwd="cowboy")
  10. return 0
  11. except subprocess.CalledProcessError:
  12. return 1
  13. def stop():
  14. try:
  15. subprocess.check_call("killall beam.smp", shell=True, cwd="/usr/bin")
  16. return 0
  17. except subprocess.CalledProcessError:
  18. return 1