get tags.

This commit is contained in:
James Pace 2025-11-22 07:37:17 -05:00
parent 76ddbbed15
commit 011ec62fea
1 changed files with 7 additions and 4 deletions

11
run.py
View File

@ -6,11 +6,13 @@ import subprocess
def main():
parser = argparse.ArgumentParser()
parser.add_argument("--install-path", type=str)
parser.add_argument("--project-dir", type=str, default=None)
parser.add_argument("--install-path", type=str)
args = parser.parse_args()
project_directory = args.project_dir
export_vcs(args.project_dir, args.install_path)
def export_vcs(project_directory, install_path):
if not project_directory:
# Assume we're being called from colcon and need to figure this out ourselves.
# When run by colcon cwd is something like <path i want>/build/package_name
@ -18,11 +20,12 @@ def main():
project_directory = cwd.parent.parent
# Where we're going to save the output.
output_file = args.install_path + "/project_state.repos"
output_file = install_path + "/project_state.repos"
# Now call vcs.
vcs_command = "vcs export {} > {}".format(project_directory, output_file)
vcs_command = "vcs export --exact-with-tags {} > {}".format(project_directory, output_file)
subprocess.run(vcs_command, shell=True)
if __name__ == "__main__":
main()