Skip to content

Commit

Permalink
Tools bugfix: Removed working directory when using idf.py
Browse files Browse the repository at this point in the history
Added check for existence of current working directory when using idf.py

Closes #11476
  • Loading branch information
Marek Fiala authored and espressif-bot committed Jun 9, 2023
1 parent 3d11043 commit ae99820
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions tools/idf.py
Original file line number Diff line number Diff line change
Expand Up @@ -699,6 +699,12 @@ def main() -> None:
# Check the environment only when idf.py is invoked regularly from command line.
checks_output = None if SHELL_COMPLETE_RUN else check_environment()

# Check existance of the current working directory to prevent exceptions from click cli.
try:
os.getcwd()
except FileNotFoundError as e:
raise FatalError(f'ERROR: {e}. Working directory cannot be established. Check it\'s existence.')

try:
cli = init_cli(verbose_output=checks_output)
except ImportError:
Expand Down

0 comments on commit ae99820

Please sign in to comment.