-
Notifications
You must be signed in to change notification settings - Fork 7
/
.Rprofile
32 lines (29 loc) · 1.32 KB
/
.Rprofile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
# only load things if you are working in Rstudio
if(interactive() && Sys.getenv("RSTUDIO", "") == "1"){
(function(){
if (!requireNamespace("devtools", quietly = TRUE)) {
return(cat("Install {devtools} to develop this package\n. `install.packages('devtools')`"))
}
cat("Load package funcs...\n")
devtools::load_all()
cat("Check if test folder exists...\n")
.dirs = list.dirs(recursive = FALSE)
.dirs_sps = grep(x = .dirs, pattern = "SPS_20", value = TRUE)
if(length(.dirs_sps)){
cat("To use the project test dir, use Ctrl+shift+h or run:\n")
cat(paste0("setwd('", normalizePath(.dirs_sps[1]), "')\n"))
} else {
cat("For developers, you may want to create a test SPS instance by `systemPipeShiny::spsInit()`\n")
}
.dirs_test = grep(x = .dirs, pattern = "test$", value = TRUE)
if(length(.dirs_test)) {
cat("Random test directory is detected, use Ctrl+shift+h or run:\n")
cat(paste0("setwd('", normalizePath(.dirs_test[1]), "')\n"))
}
})()
} else if (interactive()) {
cat("You are in SPS develop environment. It is recommended to use Rstudio to develop this package.\n")
}
# path = Sys.getenv("PATH")
# path = paste0(path, ":/home/lab/lib")
# Sys.setenv(PATH= path)