ci: allow running check-readmes pre-commit hook without IDF_PATH set

... which may happen when making a git commit using a GUI tool.
This commit is contained in:
Ivan Grokhotkov 2022-07-14 16:32:20 +02:00
parent 9653af8d04
commit 8870ffc6e1
No known key found for this signature in database
GPG Key ID: 1E050E141B280628

View File

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