Skip to content

Commit

Permalink
Move restart_rstudio()
Browse files Browse the repository at this point in the history
  • Loading branch information
jennybc committed Dec 20, 2017
1 parent e8be64a commit a6e3d9d
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 22 deletions.
22 changes: 0 additions & 22 deletions R/git.R
Expand Up @@ -31,28 +31,6 @@ use_git <- function(message = "Initial commit") {

}

# Must be last command run
restart_rstudio <- function(message = NULL) {
if (!in_rstudio(proj_get())) {
return(FALSE)
}

if (!interactive())
return(FALSE)

if (!is.null(message)) {
todo(message)
}

if (!rstudioapi::hasFun("openProject"))
return(FALSE)

if (yesno(todo_bullet(), " Restart now?"))
return(FALSE)

rstudioapi::openProject(proj_get())
}

#' Add a git hook.
#'
#' Sets up a git hook using specified script. Creates hook directory if
Expand Down
22 changes: 22 additions & 0 deletions R/rstudio.R
Expand Up @@ -107,3 +107,25 @@ build_rproj <- function(file, fields) {
is_blank <- names(file_fields) == ""
ifelse(is_blank, "", paste0(names(file_fields), ": ", file_fields))
}

# Must be last command run
restart_rstudio <- function(message = NULL) {
if (!in_rstudio(proj_get())) {
return(FALSE)
}

if (!interactive())
return(FALSE)

if (!is.null(message)) {
todo(message)
}

if (!rstudioapi::hasFun("openProject"))
return(FALSE)

if (yesno(todo_bullet(), " Restart now?"))
return(FALSE)

rstudioapi::openProject(proj_get())
}

0 comments on commit a6e3d9d

Please sign in to comment.