Skip to content

Commit

Permalink
added rappdirs
Browse files Browse the repository at this point in the history
  • Loading branch information
seankross committed Apr 2, 2015
1 parent 01c1d36 commit 84a368e
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
3 changes: 2 additions & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,6 @@ Imports:
yaml,
RCurl,
digest,
tools
tools,
rappdirs
Roxygen: list(wrap = FALSE)
11 changes: 11 additions & 0 deletions R/zzz.R
Original file line number Diff line number Diff line change
@@ -1,3 +1,14 @@
.onLoad <- function(libname, pkgname){
udd <- user_data_dir(appname = "swirl", appauthor = "swirldev", roaming = TRUE)
if(!file.exists(udd)){
dir.create(udd, recursive = TRUE)
swirl_options <- data.frame(course_path = file.path(system.file("Courses", package = "swirl")))
write.csv(swirl_options, file = file.path(udd, "swirl_options.csv"), row.names = FALSE)
}

invisible()
}

.onAttach <- function(...) {
if(length(ls(envir=globalenv())) > 0) {
packageStartupMessage(
Expand Down

0 comments on commit 84a368e

Please sign in to comment.