Skip to content

Commit

Permalink
Commit ttlr with -c | --ci change
Browse files Browse the repository at this point in the history
  • Loading branch information
eddelbuettel committed Feb 22, 2024
1 parent 8f4dadb commit d5c586d
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions inst/examples/tttl.r
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#
# testthat::test_local wrapper
#
# Copyright (C) 2019 - 2023 Dirk Eddelbuettel
# Copyright (C) 2019 - 2024 Dirk Eddelbuettel
#
# Released under GPL (>= 2)

Expand All @@ -15,10 +15,12 @@ suppressMessages({
})

## configuration for docopt
doc <- "Usage: tttl.r [-h] [-x] [ARG]
doc <- "Usage: tttl.r [-h] [-x] [-c] [ARG]
-c --ci set environment variable CI to TRUE [default: FALSE]
-h --help show this help text
-x --usage show help and short example usage"

opt <- docopt(doc) # docopt parsing

if (opt$usage) {
Expand All @@ -38,6 +40,10 @@ if (!is.null(opt$ARG) && dir.exists(opt$arg)) {
setwd(opt$ARG)
}

if (opt$ci) {
Sys.setenv(CI="TRUE")
}

if (file.exists(file.path(getwd(), "..", "..", "DESCRIPTION"))) {
setwd(file.path(getwd(), "..", ".."))
}
Expand Down

0 comments on commit d5c586d

Please sign in to comment.