Skip to content

Commit

Permalink
scripts: run_parsers: improve robustness
Browse files Browse the repository at this point in the history
  • Loading branch information
ES-Alexander authored and patrickelectric committed Jan 13, 2025
1 parent e85caa0 commit 5d27beb
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions scripts/run_parsers.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ def get_version_for_tag(self, tag) -> Tuple[int, int]:
return int(tag['matches']['major']), int(tag['matches']['minor'])
else:
# fetch number from version.h in the vehicle folder in the given tag
self.repository.git.checkout(tag["tag"])
self.repository.git.checkout(tag["tag"], force=True)
# try to read <vehicle>/version.h
path1 = Path(f'{self.repository_path}/{tag["matches"]["name"]}/version.h')
path2 = Path(f'{self.repository_path}/{self.valid_name_map[tag["matches"]["name"]]}/version.h')
Expand Down Expand Up @@ -163,7 +163,7 @@ def run(self):
script_folder = f'{self.repository_path}/Tools/scripts/'
script_file = script_folder + 'mavlink_parse.py'
shutil.copy(f'{self.temp_folder}/mavlink_parse.py', script_file)
subprocess.run([script_file, '-cguq', '--header', 'ardupilot_wiki', '--format', 'rst',
subprocess.run(['python', script_file, '-cguq', '--header', 'ardupilot_wiki', '--format', 'rst',
'--filename', f'{dest}/MAVLinkMessages.rst', '--branch', folder_name, '--vehicle', vehicle],
cwd=script_folder)
except Exception as exception:
Expand Down

0 comments on commit 5d27beb

Please sign in to comment.