Skip to content

Commit

Permalink
let start_bundle_coupled not fail on missing magpie/output folder
Browse files Browse the repository at this point in the history
  • Loading branch information
orichters committed Feb 27, 2024
1 parent a0c776c commit 056981b
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions start_bundle_coupled.R
Original file line number Diff line number Diff line change
Expand Up @@ -123,16 +123,13 @@ NC <- "\033[0m" # No Color

# define arguments that are accepted (test for backward compatibility)
startgroup <- "1"
flags <- lucode2::readArgs("startgroup", .flags = c(h = "--help", g = "--gamscompile", i = "--interactive", p = "--parallel", t = "--test"))
flags <- lucode2::readArgs("startgroup", .flags = c(h = "--help", g = "--gamscompile", i = "--interactive", t = "--test"))
if (! exists("argv")) argv <- commandArgs(trailingOnly = TRUE)
if ("--help" %in% flags) {
message(helpText)
q()
}
if ("test" %in% argv) flags <- unique(c(flags, "--test"))
if ("--parallel" %in% flags) {
message("The flag --parallel is not necessary anymore, as this is default now")
}

# load arguments from command line
argv <- grep('(^-|=|^test$)', argv, value = TRUE, invert = TRUE)
Expand All @@ -154,7 +151,8 @@ if (length(argv) > 0) {
message("")
}

if (! file.exists("output")) dir.create("output")
dir.create(file.path(path_remind, "output"), showWarnings = FALSE)
dir.create(file.path(path_magpie, "output"), showWarnings = FALSE)

ensureRequirementsInstalled(rerunPrompt = "start_bundle_coupled.R")

Expand Down

0 comments on commit 056981b

Please sign in to comment.