Skip to content

Commit f1fcdc6

Browse files
rhttpike3
authored andcommitted
feat: Let mesa runserver detect server.py as fallback
1 parent 967eada commit f1fcdc6

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

mesa/main.py

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,14 @@ def runserver(project):
3030
PROJECT is the path to the directory containing `run.py`, or the current
3131
directory if not specified.
3232
"""
33-
run_path = Path(project) / "run.py"
34-
if not run_path.exists():
35-
sys.exit(f"ERROR: file {run_path} does not exist")
36-
args = [sys.executable, str(run_path)]
37-
call(args)
33+
run_files = ["run.py", "server.py"]
34+
for run_file in run_files:
35+
run_path = Path(project) / run_file
36+
if not run_path.exists():
37+
continue
38+
args = [sys.executable, str(run_path)]
39+
call(args)
40+
sys.exit(f"ERROR: file run.py or server.py (in {Path(project)}) does not exist")
3841

3942

4043
@click.command()

0 commit comments

Comments
 (0)