Skip to content

Commit

Permalink
Set CI=TRUE.
Browse files Browse the repository at this point in the history
  • Loading branch information
robertzk committed Dec 28, 2015
1 parent da8c8ef commit 8b25c03
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 0 deletions.
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,5 +37,6 @@ notifications:
secure: l+wmlZJjYTD9Gv+oSp+y5IE6UFAwGEbfiUdoIU8VA4AihIsarEu9/h1WfuZLf00qlxktx45BLsecvn5QGX+IHVTXDFxmYyL+pzuTdNYZjc87EutstyJ1Ahdt5IA49A8X+PHAO7v60XIjrUrXPKwx3vxsVmO1RSayo0xAwfnupmk=
env:
- global:
- CI=TRUE
- WARNINGS_ARE_ERRORS=1
- _R_CHECK_FORCE_SUGGESTS_=0
32 changes: 32 additions & 0 deletions R/zzz.R
Original file line number Diff line number Diff line change
@@ -1,4 +1,36 @@
.onAttach <- function(...) {
if (!isTRUE(getOption("syberia.silent"))) {
packageStartupMessage(paste0("Loading ", crayon::red("Syberia"), "...\n"))
}

# Load better trace.
if (isTRUE(getOption("syberia.autoload_bettertrace", TRUE)) &&
!identical(Sys.getenv("CI"), "TRUE")) {
if (!is.element("devtools", utils::installed.packages()[, 1])) {
packageStartupMessage(crayon::yellow(" ...Installing devtools\n"))
utils::install.packages("devtools")
}

if (!requireNamespace("bettertrace", quietly = TRUE)) {
packageStartupMessage(crayon::yellow(" ...Installing github.com/robertzk/bettertrace\n"))
devtools::install_github("robertzk/bettertrace")
}
library(bettertrace)
}

# We want to initialize a Syberia project in the current working directory
# because 9 times out of 10 this is what the user wants.
#
# However, this hook doesn't work on install, because install is done from
# the working directory of the package, not the user.
#
# But when the user calls library(syberia), this will work.
try({
syberia_engine()
packageStartupMessage(crayon::yellow(
"Loaded syberia project ", sQuote(active_project()$root()), "...\n"
))
}, silent = TRUE)
}

.onDetach <- function(...) {
Expand Down

0 comments on commit 8b25c03

Please sign in to comment.