Skip to content

Conversation

@samsrabin
Copy link
Contributor

@samsrabin samsrabin commented Jan 19, 2026

This gives relink.py the ability to accept an arbitrary number of directories and/or files to relink, given as positional arguments.

Resolves issue #5. Includes PR #13.

E.g.:

python3 relink.py /path/to/inputdata/source1/ /path/to/inputdata/source2/file2.txt --target-root /path/to/target/
usage: relink.py [-h] [--target-root TARGET_ROOT] [-v | -q] [--dry-run] [--timing] [items_to_process ...]

Find files owned by a user and replace them with symbolic links to a target directory.

positional arguments:
  items_to_process      One or more (directories to search for) files (default: /glade/campaign/cesm/cesmdata/cseg/inputdata/)

options:
  -h, --help            show this help message and exit
  --target-root TARGET_ROOT
                        The root of the directory tree where files should be moved to (default:
                        /glade/campaign/collections/gdex/data/d651077/cesmdata/inputdata/)
  -v, --verbose         Enable verbose output
  -q, --quiet           Quiet mode (show only warnings and errors)
  --dry-run             Show what would be done without making any changes
  --timing              Measure and display the execution time

@samsrabin samsrabin self-assigned this Jan 19, 2026
@samsrabin samsrabin added the enhancement New feature or request label Jan 19, 2026
@codecov-commenter
Copy link

codecov-commenter commented Jan 19, 2026

Codecov Report

❌ Patch coverage is 99.50678% with 4 lines in your changes missing coverage. Please review.
✅ Project coverage is 99.26%. Comparing base (ecc9a4a) to head (5e854b9).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
tests/relink/test_find_owned_files_scandir.py 97.29% 2 Missing ⚠️
relink.py 98.90% 1 Missing ⚠️
tests/relink/test_handle_non_dir.py 99.50% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main      #15      +/-   ##
==========================================
+ Coverage   99.23%   99.26%   +0.03%     
==========================================
  Files          10       12       +2     
  Lines         780     1353     +573     
==========================================
+ Hits          774     1343     +569     
- Misses          6       10       +4     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants