Skip to content

Commit

Permalink
check for rstudioapi
Browse files Browse the repository at this point in the history
  • Loading branch information
vnijs committed May 16, 2017
1 parent e66b0fe commit 7e119f3
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 5 deletions.
7 changes: 4 additions & 3 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
Package: radiant
Type: Package
Title: Business Analytics using R and Shiny
Version: 0.8.0
Date: 2017-4-28
Version: 0.8.1
Date: 2017-5-16
Authors@R: person("Vincent", "Nijs", , "[email protected]", c("aut", "cre"))
Description: A platform-independent browser-based interface for business
analytics in R, based on the shiny package. The application combines the
Expand All @@ -19,7 +19,8 @@ Imports:
psych (>= 1.6.6),
AlgDesign (>= 1.1.7.3),
shiny (>= 1.0.0),
import (>= 1.1.0)
import (>= 1.1.0),
rstudioapi (>= 0.6)
Suggests:
testthat (>= 1.0.0),
knitr,
Expand Down
1 change: 1 addition & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,5 @@ import(radiant.model)
import(radiant.multivariate)
import(shiny)
importFrom(import,from)
importFrom(rstudioapi,isAvailable)
importFrom(utils,new.packages)
4 changes: 4 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# CHANGES IN radiant VERSION 0.8.1

- Added a check to see if radiant::update_radiant() is running in Rstudio

# CHANGES IN radiant VERSION 0.8.0

Updated dependency requirements for radiant menus contained in packages radiant.data, radiant.design, radiant.basics, radiant.model, and radiant.multivariate. See the NEWS.md files for those packages for additional information about changes.
14 changes: 12 additions & 2 deletions R/radiant.R
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ radiant <- function() {
#' radiant::update_radiant()
#' }
#'
#' @importFrom rstudioapi isAvailable
#'
#' @export
update_radiant <- function() {

Expand Down Expand Up @@ -52,8 +54,16 @@ update_radiant <- function() {
## message to alternative update command, temporary fail-safe
message("Alternative update command:\n\nsource('https://raw.githubusercontent.com/radiant-rstats/minicran/gh-pages/build.R')")

## Restarting Rstudio session from http://stackoverflow.com/a/25934774/1974918
ret <- .rs.restartR(cmd)
## check if run from Rstudio
if (rstudioapi::isAvailable()) {
## Restarting Rstudio session from http://stackoverflow.com/a/25934774/1974918
ret <- .rs.restartR(cmd)
} else {
if (cmd != "") {
message("Please restart R and run the following command to complete the update:\n\n", cmd)
}
}

}

#' Create a launcher and updater for Windows (.bat)
Expand Down

0 comments on commit 7e119f3

Please sign in to comment.