Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Check if rstudioapi is available #277

Merged
merged 1 commit into from May 3, 2024
Merged

Check if rstudioapi is available #277

merged 1 commit into from May 3, 2024

Conversation

jennybc
Copy link
Member

@jennybc jennybc commented May 2, 2024

In terms of guarding calls to rstudioapi::hasFun() and rstudioapi::callFun(), it seems more appropriate to use rstudioapi::isAvailable() than to directly consult .Platform$GUI. This is what we do in usethis, for example:

https://github.com/r-lib/usethis/blob/9e64daf13ac1636187d59e6446d9526a414d8ba6/R/rstudio.R#L129-L131

I didn't replace is_rstudio() wholesale because it's possible that the remaining uses really do need to consult .Platform$GUI.

@jennybc jennybc requested a review from lionel- May 2, 2024 19:23
@jennybc
Copy link
Member Author

jennybc commented May 3, 2024

I have re-run the failing check (windows-latest + R 3.6) and it still failed. So it doesn't seem to be random, but I also don't see how it could be related to this PR.

@jennybc jennybc merged commit f7fc41f into main May 3, 2024
11 of 12 checks passed
@jennybc jennybc deleted the use-rstudioapi branch May 7, 2024 20:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants