Relative path to chalice local command
- Dominant language
- Python
- Stars
- 11.1k
- Forks
- 1k
- Avg merge
- 1d 22h
- Merged PRs (30d)
- 2
Description
``` File "/Users/.virtualenvs/venv/lib/python3.7/site-packages/click/core.py", line 717, in main
rv = self.invoke(ctx)
File "/Users/.virtualenvs/venv/lib/python3.7/site-packages/click/core.py", line 1134, in invoke
Command.invoke(self, ctx)
File "/Users/.virtualenvs/venv/lib/python3.7/site-packages/click/core.py", line 956, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/Users/.virtualenvs/venv/lib/python3.7/site-packages/click/core.py", line 555, in invoke
return callback(*args, **kwargs)
File "/Users/.virtualenvs/venv/lib/python3.7/site-packages/click/decorators.py", line 17, in new_func
return f(get_current_context(), *args, **kwargs)
File "/Users/.virtualenvs/venv/lib/python3.7/site-packages/chalice/cli/__init__.py", line 114, in cli
os.chdir(project_dir)
FileNotFoundError: [Errno 2] No such file or directory: '/Users/Workspace/Projects/lambdas/lambdas'
(venv) [user@cmp ~/Workspace/Projects ]$ chalice --project-dir ./lambdas/ local
```
app.py is in a directory named lambdas.
Why does it show two lambdas at the end of error?
It however works fine with complete file path.
Contributor guide
Research direction
Start in chalice/cli/__init__.py at the os.chdir(project_dir) call shown in the traceback, then reproduce `chalice --project-dir ./lambdas/ local` from the parent directory. Trace how the relative project path is resolved; done means the command locates the existing app directory without duplicating `lambdas` and preserves the working complete-path behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- cli
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100