Nelze vybrat více než 25 témat Téma musí začínat písmenem nebo číslem, může obsahovat pomlčky („-“) a může být dlouhé až 35 znaků.

46 lines
1.2KB

  1. #!/usr/bin/env Rscript
  2. # This is a helper script to run the pipeline.
  3. # Choose how to execute the pipeline below.
  4. # See https://books.ropensci.org/targets/hpc.html
  5. # to learn about your options.
  6. 'usage:
  7. run.R all [--reporter <reporter> --no-crew]
  8. run.R target <targets>... [--shortcut --reporter <reporter> --no-crew --debug]
  9. run.R -h | --help
  10. options:
  11. --reporter <reporter> Reporter type for `tar_make()` [default: verbose_positives].
  12. --no-crew Disable crew?
  13. -h --help Show this screen' -> doc
  14. library(docopt)
  15. opts <- docopt(doc)
  16. Sys.setenv("IN_TARGETS" = "true")
  17. Sys.setenv("ALLOW_DOWNLOADS" = "true")
  18. if (opts$debug) {
  19. str(opts)
  20. stop()
  21. }
  22. if (is.null(opts$reporter)) {
  23. opts$reporter <- "verbose_positives"
  24. }
  25. no_crew <- isTRUE(opts$no_crew)
  26. if (no_crew) {
  27. cli::cli_alert_info("Disabling {.field crew}.")
  28. }
  29. if (opts$all) {
  30. cli::cli_alert_info("Running all targets.")
  31. targets::tar_make(reporter = opts$reporter, use_crew = !no_crew)
  32. } else {
  33. cli::cli_alert_info("Running targets: {.and {.field {opts$targets}}}")
  34. targets::tar_make(targets::any_of(!!opts$targets), shortcut = opts$shortcut, reporter = opts$reporter, use_crew = !no_crew)
  35. }
  36. # targets::tar_make_clustermq(workers = 2) # nolint