Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Non-CLI usage of nf-core download #3043

Open
seedgeorge opened this issue Jun 28, 2024 · 3 comments
Open

Non-CLI usage of nf-core download #3043

seedgeorge opened this issue Jun 28, 2024 · 3 comments
Labels

Comments

@seedgeorge
Copy link

Description of feature

Hi there,

Currently the nf-core download command doesn't permit a parameter-based answer to to the Define $NXF_SINGULARITY_CACHEDIR f question that pops up on the command-line interface. For the purposes of putting this command in a script, it would be handy to not have to interact with a command line prompt at all.

Thanks for the useful tool!

@seedgeorge seedgeorge changed the title Improve non-CLI usage of nf-core download Non-CLI usage of nf-core download Jun 28, 2024
@MatthiasZepper
Copy link
Member

MatthiasZepper commented Jul 18, 2024

Sorry for the late reply.

Technically, this should already be the case. The code has a check that should prevent prompts from being shown in non-interactive sessions:

tools/nf_core/download.py

Lines 440 to 444 in 930ece5

if (
self.container_system == "singularity"
and os.environ.get("NXF_SINGULARITY_CACHEDIR") is None
and stderr.is_interactive # Use rich auto-detection of interactive shells
):

Why this detection fails in your case, I can't tell. Have you tried to pipe the output to tee, cat or tail or something? At least the pipe should be detected, and any interactive prompts thus turned off.

@muffato muffato added bug Something isn't working download nf-core download and removed enhancement labels Sep 3, 2024
@ewels
Copy link
Member

ewels commented Sep 26, 2024

Is there a reason that you can't provide it on the same line as the command? eg.

NXF_SINGULARITY_CACHEDIR="/path/to/cache" nf-core download

Then as @MatthiasZepper says, the interactive prompt shouldn't show. And it is not super different to using a flag with the path after the command.

@MatthiasZepper
Copy link
Member

MatthiasZepper commented Sep 26, 2024

I presume, that the original poster does not want to define a cache directory?

@MatthiasZepper MatthiasZepper added awaiting-feedback and removed bug Something isn't working labels Oct 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants