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

'reset' gcloud_account()? #70

Open
mtmorgan opened this issue Nov 22, 2022 · 0 comments
Open

'reset' gcloud_account()? #70

mtmorgan opened this issue Nov 22, 2022 · 0 comments

Comments

@mtmorgan
Copy link
Collaborator

mtmorgan commented Nov 22, 2022

From @shbrief gcloud_account() or gcloud_account(account = NULL) returns the current account, gcloud_account(account = "xxx") sets the account to xxx. How to reset to original (when package started) value?

A workaround is to record the original value

original_account <- gcloud_account()

then do work and at some point

gcloud_account(original_account)

This could be automated, so that for instance gcloud_account(account = NA) resets the value to the account at the beginning of the R session (when the AnVIL package was loaded?) but is this consistent with the workflow that is desired to be supported? If this were to be in a package, then the package could implement this with

gcloud_account_value <- NULL

.onLoad <- function(...) {
    gcloud_account_value <<- gcloud_account()
}

gcloud_account_reset <- function() {
    gcloud_accoutn(gcloud_account_value)
}
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

No branches or pull requests

1 participant