From 615285f6de2a06656eebaf43ca26919b9e0e547f Mon Sep 17 00:00:00 2001 From: Jan Beran Date: Tue, 27 Feb 2024 11:49:48 +0100 Subject: [PATCH] fix(install.ps1): fix ReferenceError in install.ps1 script This fix preventing RefferenceError when accessing g.idf_path before initialization --- tools/idf_tools.py | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/tools/idf_tools.py b/tools/idf_tools.py index 796d5c5670..0402f4d9c8 100755 --- a/tools/idf_tools.py +++ b/tools/idf_tools.py @@ -3155,11 +3155,7 @@ def main(argv: List[str]) -> None: if 'unset' in args and args.unset: args.deactivate = True - g.idf_path = os.environ.get('IDF_PATH') # type: ignore - if args.idf_path: - g.idf_path = args.idf_path - if not g.idf_path: - g.idf_path = os.path.realpath(os.path.join(os.path.dirname(__file__), '..')) + g.idf_path = args.idf_path or os.environ.get('IDF_PATH') or os.path.realpath(os.path.join(os.path.dirname(__file__), '..')) os.environ['IDF_PATH'] = g.idf_path g.idf_tools_path = os.environ.get('IDF_TOOLS_PATH') or os.path.expanduser(IDF_TOOLS_PATH_DEFAULT)