Skip to content

Commit

Permalink
added some documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
francinelapid committed Mar 19, 2024
1 parent c77707f commit f1e1690
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lib/pavilion/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)


Expand Down

0 comments on commit f1e1690

Please sign in to comment.