arguments <- commandArgs(trailingOnly = TRUE)
names(arguments) <- c("recipe", "tmpfile")

library(yaml)
source('ChristmasTree.R')
source('divide_recipe.R')
source('decide_nice_layout.R')
recipe <- read_yaml(arguments[1])
atomic_recipes <- divide_recipe(recipe)

## TODO: Export necessary variables
layout <- decide_nice_layout(atomic_recipes$n_atomic_recipes)
sink(arguments[2], append = FALSE)
cat(paste0(layout[1]), "\n")
cat(paste0(layout[2]), "\n")
cat(paste0(dirname(recipe$fileout), "\n"))
cat(recipe$fileout)
sink()
