Skip to content

Commit

Permalink
Merge pull request #155 from ropensci/respect
Browse files Browse the repository at this point in the history
Don't overwrite DataPackageR_verbose option set outside package
  • Loading branch information
slager authored May 31, 2024
2 parents b37e71f + fb114e5 commit 75ef35c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
- `dataVersion()`, renamed years ago to `data_version()`
- `datapackage.skeleton()`, renamed years ago to `datapackage_skeleton()`
- `keepDataObjects()`
* Keep existing DataPackageR_verbose option if set outside of package

## Internal improvements

Expand Down
6 changes: 3 additions & 3 deletions R/zzz.R
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
.onLoad <- function(libname, pkgname) {
# keeping this first option hardcoded on load for now
options("DataPackageR_packagebuilding" = FALSE)
options("DataPackageR_verbose" = TRUE)
# respect previous user setting for 'DataPackageR_interact' if set
# respect previous user setting for options if set
op <- options()
op.DataPackageR <- list(
DataPackageR_interact = interactive()
DataPackageR_interact = interactive(),
DataPackageR_verbose = TRUE
)
toset <- !(names(op.DataPackageR) %in% names(op))
if (any(toset)) options(op.DataPackageR[toset])
Expand Down

0 comments on commit 75ef35c

Please sign in to comment.