From 86898ed387b067c15d010db0d4fb34d12624ba24 Mon Sep 17 00:00:00 2001 From: Bela Stoyan Date: Sun, 28 Jan 2024 22:40:48 +0100 Subject: [PATCH] separate `tool` from `conda_package` --- copier.yml | 10 +++++++++- template/environment.yml.jinja | 2 +- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/copier.yml b/copier.yml index 8c21126..c64f6e7 100644 --- a/copier.yml +++ b/copier.yml @@ -25,12 +25,20 @@ entry: {% if entry == '' %} Please provide an entry {% endif %} +conda_package: + type: str + help: What is the conda package name? + default: '{{ tool }}' + validator: >- + {% if conda_package == '' %} + Please provide a conda package name + {% endif %} description: type: str help: What is the description of the tool? default: This hook runs {{ tool }}. _tasks: - - sed -i "s/TOOL_VERSION/$(micromamba search -c conda-forge {{ tool }} --json | jq -r '.result.pkgs[0].version')/g" environment.yml + - sed -i "s/TOOL_VERSION/$(micromamba search -c conda-forge {{ conda_package }} --json | jq -r '.result.pkgs[0].version')/g" environment.yml - git init - git branch -M main diff --git a/template/environment.yml.jinja b/template/environment.yml.jinja index 0fd2d76..d71ddd1 100644 --- a/template/environment.yml.jinja +++ b/template/environment.yml.jinja @@ -2,4 +2,4 @@ channels: - conda-forge - nodefaults dependencies: - - {{ tool }}=TOOL_VERSION + - {{ conda_package }}=TOOL_VERSION