Skip to content

Commit

Permalink
feat: Allow relative paths in wave run. Closes #2160
Browse files Browse the repository at this point in the history
  • Loading branch information
mturoci committed Oct 19, 2023
1 parent d066e8e commit b5e596e
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions py/h2o_wave/h2o_wave/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,10 @@ def run(app: str, no_reload: bool, no_autostart: bool):
# uvicorn.main() does this before calling uvicorn.run().
sys.path.insert(0, '.')

# Allow relative paths from bash autocomplete. E.g. wave run ./foo.py
if app.startswith(f'.{os.path.sep}'):
app = app[2:]

# DevX: treat foo/bar/baz.py as foo.bar.baz
app_path, ext = os.path.splitext(app)
if ext.lower() == '.py':
Expand Down

0 comments on commit b5e596e

Please sign in to comment.