Просмотр исходного кода

Merge branch 'bugfix/empty_get_version_cmd' into 'master'

fix(idf_tools): execution of empty command in get_version()

Closes IDFGH-10649

See merge request espressif/esp-idf!24978
Roland Dobai 2 лет назад
Родитель
Сommit
8eaa59840f
1 измененных файлов с 7 добавлено и 0 удалено
  1. 7 0
      tools/idf_tools.py

+ 7 - 0
tools/idf_tools.py

@@ -689,6 +689,13 @@ class IDFTool(object):
         cmd = self._current_options.version_cmd  # type: ignore
         if executable_path:
             cmd[0] = executable_path
+
+        if not cmd[0]:
+            # There is no command available, so return early. It seems that
+            # within some very strange context empty [''] may actually execute
+            # something https://github.com/espressif/esp-idf/issues/11880
+            raise ToolNotFound('Tool {} not found'.format(self.name))
+
         try:
             version_cmd_result = run_cmd_check_output(cmd, None, extra_paths)
         except OSError: