소스 검색

Tools bugfix: Removed working directory when using idf.py

Added check for existence of current working directory when using idf.py

Closes https://github.com/espressif/esp-idf/issues/11476
Marek Fiala 2 년 전
부모
커밋
ae99820399
1개의 변경된 파일6개의 추가작업 그리고 0개의 파일을 삭제
  1. 6 0
      tools/idf.py

+ 6 - 0
tools/idf.py

@@ -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: