From e8ee59f68bec505aa4a7932f47243b0ac3da43a0 Mon Sep 17 00:00:00 2001 From: Marek Fiala Date: Tue, 18 Jul 2023 14:08:37 +0200 Subject: [PATCH] fix(tools): create-project with proper file permission - pre-commit fix Closes https://github.com/espressif/esp-idf/pull/11836 --- tools/test_build_system/test_common.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/tools/test_build_system/test_common.py b/tools/test_build_system/test_common.py index c46e83f5f3..6f46de169e 100644 --- a/tools/test_build_system/test_common.py +++ b/tools/test_build_system/test_common.py @@ -241,11 +241,12 @@ def test_create_project_with_idf_readonly(idf_copy: Path) -> None: def change_to_readonly(src: Path) -> None: for root, dirs, files in os.walk(src): for name in dirs: - os.chmod(os.path.join(root, name), 0o555) # read & execute + os.chmod(os.path.join(root, name), 0o555) # read & execute for name in files: path = os.path.join(root, name) - if '/bin/' in path: continue # skip excutables - os.chmod(os.path.join(root, name), 0o444) # readonly + if '/bin/' in path: + continue # skip excutables + os.chmod(os.path.join(root, name), 0o444) # readonly logging.info('Check that command for creating new project will success if the IDF itself is readonly.') change_to_readonly(idf_copy) run_idf_py('create-project', '--path', str(idf_copy / 'example_proj'), 'temp_test_project')