From 8870ffc6e148e0dd687d8022a49e4af9246c886d Mon Sep 17 00:00:00 2001 From: Ivan Grokhotkov Date: Thu, 14 Jul 2022 16:32:20 +0200 Subject: [PATCH] ci: allow running check-readmes pre-commit hook without IDF_PATH set ... which may happen when making a git commit using a GUI tool. --- tools/ci/check_build_test_rules.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tools/ci/check_build_test_rules.py b/tools/ci/check_build_test_rules.py index 97063ba442..2a9c242aa7 100755 --- a/tools/ci/check_build_test_rules.py +++ b/tools/ci/check_build_test_rules.py @@ -406,6 +406,9 @@ if __name__ == '__main__': arg = parser.parse_args() + # Since this script is executed from the pre-commit hook environment, make sure IDF_PATH is set + os.environ['IDF_PATH'] = os.path.realpath(os.path.join(os.path.dirname(__file__), '..', '..')) + if arg.action == 'sort-yaml': sort_yaml(arg.files) else: