From f1e1690054a6ecf7504f566be051c2e608cdb299 Mon Sep 17 00:00:00 2001 From: Maria Francine Therese Ruiz Lapid Date: Tue, 19 Mar 2024 13:41:06 -0600 Subject: [PATCH] added some documentation --- lib/pavilion/utils.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/pavilion/utils.py b/lib/pavilion/utils.py index c9fdcc449..8a5d3f092 100644 --- a/lib/pavilion/utils.py +++ b/lib/pavilion/utils.py @@ -196,14 +196,17 @@ def path_is_external(path: Path): def symlinktree(source_directory, destination_directory): + """Recursively create symlinks from test source directory to builds directory in working_dir""" + for root, dirs, files in os.walk(source_directory): for file in files: src_path = os.path.join(root, file) rel_path = os.path.relpath(src_path, source_directory) dst_path = os.path.join(destination_directory, rel_path) - # Create + # Create parent dir if it doesn't already exist os.makedirs(os.path.dirname(dst_path), exist_ok=True) + # Create the symlink os.symlink(src_path, dst_path)