#!/bin/bash

############ AUTOSUBMIT INPUTS ############
projdir=%PROJDIR%
outdir=%common.OUTDIR%
recipe=%common.RECIPE%
tmpdir=%common.TMPDIR%
###############################

if [ -d $projdir ]; then
  cd $projdir
  srcdir=${outdir}
else
  cd ${tmpdir}/sunset/$(basename ${outdir})/
  srcdir=${tmpdir}/$(basename ${outdir})
fi

recipe=${srcdir}/logs/recipes/${recipe}

set +eu
source MODULES
set -eu

export OPENSSL_CONF=/dev/null
Rscript modules/Scorecards/execute_scorecards.R ${recipe} ${srcdir}
