Skip to content

Commit

Permalink
Merge branch 'bugfix/removed_working_directory_error_v5.1' into 'rele…
Browse files Browse the repository at this point in the history
…ase/v5.1'

Tools bugfix: Removed working directory when using idf.py (v5.1)

See merge request espressif/esp-idf!24150
  • Loading branch information
dobairoland committed Jun 30, 2023
2 parents b48beba + 8a9f12e commit c8ea979
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 @@ -691,6 +691,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 its existence.')

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

0 comments on commit c8ea979

Please sign in to comment.