Skip to content

nfcoreLibraryLinker: exit gracefully when directories don't exist#50

Merged
maxulysse merged 3 commits into
nf-core:mainfrom
prototaxites:unlink_warn
Oct 6, 2025
Merged

nfcoreLibraryLinker: exit gracefully when directories don't exist#50
maxulysse merged 3 commits into
nf-core:mainfrom
prototaxites:unlink_warn

Conversation

@prototaxites

Copy link
Copy Markdown
Contributor

Presently, the nfcoreLibraryLinker function throws an exception if either the temporary nf-core library or the target modules directory do not exist.

This causes some issues with tests that call this function in the cleanup {} block of an nf-test, when nf-test is executed in --dry-run mode, as the dry-run mode tries to execute the cleanup block (but not the setup block): askimed/nf-test#330

See e.g. https://github.com/sanger-tol/nf-core-modules/blob/main/modules/sanger-tol/hiccramalign/minimap2align/tests/main.nf.test for an example of a test that fails.

This PR modifies the nfcoreLibraryLinker function to print a warning and exit gracefully when either directory doesn't exist (because set-up hasn't run). This is safe because if the directories don't exist, nothing should have been linked to or from them in any case.

This will temporarily side-step the problem we are having until it can be fixed upstream in nf-test.

@maxulysse maxulysse merged commit c35ee7c into nf-core:main Oct 6, 2025
5 checks passed
@prototaxites prototaxites deleted the unlink_warn branch October 6, 2025 10:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants