From 011ec62feaf74642c449a41610f0ca82e5e95bca Mon Sep 17 00:00:00 2001 From: James Pace Date: Sat, 22 Nov 2025 07:37:17 -0500 Subject: [PATCH] get tags. --- run.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/run.py b/run.py index 1590975..970e39c 100755 --- a/run.py +++ b/run.py @@ -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 /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()