From b7dcf7bc696aad395b364ace5cbe5f0afc982ce6 Mon Sep 17 00:00:00 2001 From: Rodrigo Arias Mallo Date: Tue, 30 Mar 2021 16:35:47 +0200 Subject: [PATCH] rplot: add support for gziped datasets --- garlic/pp/rplot.nix | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/garlic/pp/rplot.nix b/garlic/pp/rplot.nix index 9366fb0..12b3b47 100644 --- a/garlic/pp/rplot.nix +++ b/garlic/pp/rplot.nix @@ -31,9 +31,16 @@ in stdenv.mkDerivation { export FONTCONFIG_PATH=${fontconfig.out}/etc/fonts mkdir -p $out cd $out - ln -s ${dataset} input + dataset="${dataset}" + + ln -s $dataset input Rscript --vanilla ${script} ${dataset} - jq -c .total_time input |\ + + if [ "''${dataset##*.}" == gz ]; then + gunzip --stdout $dataset + else + cat $dataset + fi | jq -c .total_time |\ awk '{s+=$1} END {printf "%f\n", s/60}' > total_job_time_minutes ''; }