Skip to content

Commit

Permalink
update start_server script with param start
Browse files Browse the repository at this point in the history
  • Loading branch information
shockcao committed Mar 6, 2017
1 parent d2da17e commit f0be959
Showing 1 changed file with 17 additions and 13 deletions.
30 changes: 17 additions & 13 deletions samples/Server/start_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,23 @@

def main():
while True:
num = raw_input("\033[0;33mEnter menu:\n1. start server on Mac, Linux or Cygwin.\n2. start server on Windows.\n3. exit.\033[0m\n")
if num == "1":
os.system("chmod +x ./gradlew && ./gradlew :server:startProxyServer")
return
elif num == "2":
os.system("gradlew.bat :server:startProxyServer")
return
elif num == "3":
print("exit!")
return
else:
continue
if len(sys.argv) >=2 and len(sys.argv[1])==1 and sys.argv[1] >="1" and sys.argv[1] <="2":
num = sys.argv[1]
else:
num = raw_input("\033[0;33mEnter menu:\n1. start server on Mac, Linux or Cygwin.\n2. start server on Windows.\n3. exit.\033[0m\n")

if num == "1":
os.system("chmod +x ./gradlew && ./gradlew :server:startProxyServer")
return
elif num == "2":
os.system("gradlew.bat :server:startProxyServer")
return
elif num == "3":
print("exit!")
return
else:
continue

if __name__ == "__main__":

main()
main()

0 comments on commit f0be959

Please sign in to comment.