From 8f83e94bdcd7285fef10d67559b075de46f271e7 Mon Sep 17 00:00:00 2001 From: Bryn Pickering <17178478+brynpickering@users.noreply.github.com> Date: Fri, 2 Aug 2024 14:11:46 +0100 Subject: [PATCH] Add `-o` option to unzip calls --- CHANGELOG.md | 1 + rules/hydro.smk | 4 ++-- rules/jrc-idees.smk | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a57be3c8..450cc759 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -70,6 +70,7 @@ * **UPDATE** dropped support for Intel macOS. The workflow may still run on Intel macOS, but we do not actively maintain support (#369). * **UPDATE** link to GADM data following changes upstream (#376). * **UPDATE** link to NUTS data to allow for different NUTS years (#380, #382). +* **UPDATE** unzip command to always overwrite existing data if it is called (#327). ### Fixed (models) diff --git a/rules/hydro.smk b/rules/hydro.smk index bef5b717..d4d51f5e 100644 --- a/rules/hydro.smk +++ b/rules/hydro.smk @@ -67,7 +67,7 @@ rule basins_database: output: "build/data/basins/hybas_eu_lev07_v1c.shp" conda: "../envs/shell.yaml" localrule: True - shell: "unzip {input} -d ./build/data/basins/" + shell: "unzip -o {input} -d ./build/data/basins/" rule stations_database: @@ -79,7 +79,7 @@ rule stations_database: localrule: True shell: """ - unzip -j {input} "**/jrc-hydro-power-plant-database.csv" -d build/data/ + unzip -o -j {input} "**/jrc-hydro-power-plant-database.csv" -d build/data/ """ diff --git a/rules/jrc-idees.smk b/rules/jrc-idees.smk index 60c87e00..25af7391 100644 --- a/rules/jrc-idees.smk +++ b/rules/jrc-idees.smk @@ -26,7 +26,7 @@ rule jrc_idees_unzipped: sector = "industry|transport|tertiary" output: temp("build/data/jrc-idees/{sector}/unprocessed/{country_code}.xlsx") conda: "../envs/shell.yaml" - shell: "unzip -p {input.country_data} JRC-IDEES-2015_{params.sector_title_case}_{wildcards.country_code}.xlsx > {output}" + shell: "unzip -o -p {input.country_data} JRC-IDEES-2015_{params.sector_title_case}_{wildcards.country_code}.xlsx > {output}" rule jrc_idees_industry_processed: