Skip to content

Commit

Permalink
Packge Startup Message: Let user know where to report bugs, and how t…
Browse files Browse the repository at this point in the history
…o get set up
  • Loading branch information
brendan-r committed May 25, 2015
1 parent 568aafe commit e18864d
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 1 deletion.
20 changes: 19 additions & 1 deletion R/boxr__internal_misc.R
Original file line number Diff line number Diff line change
@@ -1,3 +1,22 @@
# Function to present different package startup messages, based on whether or
# not it looks like the user has used boxr before
boxrStartupMessage <- function(){
new_user <- !file.exists("~/.boxr-oath")

packageStartupMessage(paste0(
"Welcome to boxr ", utils::packageVersion("boxr"), "!\n",
"Bug reports: https://github.com/brendan-R/boxr/issues",
if(new_user)
paste0(
"\n\nSee vignette('boxr') for a short guide on connecting your box.com ",
"account to R."
),
""
))
}



# Short function to tidy up the variable which stores the creation of new remote
# directories, putting the id at the same place on each
dir_id_tidy <- function(x){
Expand Down Expand Up @@ -69,7 +88,6 @@ box_datetime <- function(x){
as.POSIXct(paste0(dt, tz), format = "%Y-%m-%dT%H:%M:%S%z")
}


checkAuth <- function(){
if(is.null(getOption("boxr.token")))
stop("It doesn't look like you've set up authentication for boxr yet.\n",
Expand Down
1 change: 1 addition & 0 deletions R/zzz.R
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
.onAttach <- function(libname, pkgname) {
boxAuthOnAttach()
boxrStartupMessage()
}

.onLoad <- function(libname, pkgname) {
Expand Down

0 comments on commit e18864d

Please sign in to comment.