Skip to content

Commit

Permalink
Merge branch 'main' into remove_as_data_frame_param
Browse files Browse the repository at this point in the history
  • Loading branch information
bnowok authored Oct 25, 2024
2 parents abb7da6 + 275d4f4 commit deb53ee
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
16 changes: 16 additions & 0 deletions R/access.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
have_access <- function() {
file.access(get_lookups_dir(), 4) >= 0L
}
check_lookups_access <- function(fail_on_no_access = TRUE) {
if (!have_access()) {
no_access_msg <- c(
"x" = "You don't have the appropriate file permissions to {get_lookups_dir()}",

Check warning on line 7 in R/access.R

View workflow job for this annotation

GitHub Actions / lint

file=R/access.R,line=7,col=81,[line_length_linter] Lines should not be more than 80 characters. This line is 85 characters.
"i" = "Please raise a ServiceNow request for access to the UNIX acute dataset"

Check warning on line 8 in R/access.R

View workflow job for this annotation

GitHub Actions / lint

file=R/access.R,line=8,col=81,[line_length_linter] Lines should not be more than 80 characters. This line is 84 characters.
)
if (fail_on_no_access) {
cli::cli_abort(no_access_msg)
} else {
cli::cli_warn(no_access_msg)
}
}
}
3 changes: 3 additions & 0 deletions R/zzz.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.onLoad <- function(libname, pkgname) {
check_lookups_access(fail_on_no_access = FALSE)
}

0 comments on commit deb53ee

Please sign in to comment.