Skip to content

Commit

Permalink
Merge pull request #733 from TimTaylor/main
Browse files Browse the repository at this point in the history
Fix #621
  • Loading branch information
gaborcsardi authored Oct 17, 2024
2 parents 9fc1bbd + dfe880b commit 20f41c8
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions R/aab-rstudio-detect.R
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,13 @@ rstudio <- local({
args = commandArgs(),
search = search()
)
d$ver <- if (d$api) asNamespace("rstudioapi")$getVersion()
d$desktop <- if (d$api) asNamespace("rstudioapi")$versionInfo()$mode

if (d$api) {
ns <- asNamespace("rstudioapi")
d$ver <- if (d$api) ns$getVersion()
new_api <- package_version(getNamespaceVersion(ns)) >= "0.17.0"
d$desktop <- if (new_api) ns$getMode() else ns$versionInfo()$mode
}

d
}
Expand Down

0 comments on commit 20f41c8

Please sign in to comment.