Browse Source

First attempt for revel on windows

Rob Figueiredo 12 years ago
parent
commit
2dc52740d4
2 changed files with 11 additions and 0 deletions
  1. 4 0
      revel/setup.bat
  2. 7 0
      revel/setup.py

+ 4 - 0
revel/setup.bat

@@ -0,0 +1,4 @@
+set GOPATH=C:\FrameworkBenchmarks\revel
+go get -u github.com/robfig/revel
+go build -o bin\revel.exe github.com/robfig/revel/cmd
+bin\revel.exe benchmark prod 8080

+ 7 - 0
revel/setup.py

@@ -6,12 +6,19 @@ import time
 
 def start(args):
   setup_util.replace_text("revel/src/benchmark/conf/app.conf", "tcp\(.*:3306\)", "tcp(" + args.database_host + ":3306)")
+  if os.name == 'nt':
+    subprocess.Popen("setup.bat", shell=True, cwd="revel")
+    return 0
   subprocess.call("go get github.com/robfig/revel/cmd", shell=True, cwd="revel")
   subprocess.call("go build -o bin/revel github.com/robfig/revel/cmd", shell=True, cwd="revel")
   subprocess.Popen("bin/revel run benchmark prod".rsplit(" "), cwd="revel")
   return 0
 
 def stop():
+  if os.name == 'nt':
+    subprocess.call("taskkill /f /im go.exe > NUL", shell=True)
+    subprocess.call("taskkill /f /im revel.exe > NUL", shell=True)
+    return 0
   p = subprocess.Popen(['ps', 'aux'], stdout=subprocess.PIPE)
   out, err = p.communicate()
   for line in out.splitlines():