source('tools/libs.R')
source('modules/Scorecards/Scorecards.R')

args = commandArgs(trailingOnly = TRUE)
recipe_file <- args[1]
output_dir <- args[2]

## TODO: Replace with function
# Read recipe and set outdir
recipe <- read_yaml(recipe_file)
recipe$Run$output_dir <- output_dir
recipe$Analysis$Datasets$System <- recipe$Analysis$Datasets$System[[1]]
recipe$Analysis$Datasets$Reference <- recipe$Analysis$Datasets$Reference[[1]]
recipe$Analysis$Variables <- recipe$Analysis$Variables[[1]]

# Plot Scorecards
plot_scorecards(recipe)
print("##### SCORECARDS SAVED TO THE OUTPUT DIRECTORY #####")
