bedatadriven / activityinfo-R

ActivityInfo R Language Client
https://www.activityinfo.org/support/docs/R/
17 stars 12 forks source link

Authenticate without asking user if they would like to save the credentials file #40

Closed nickdickinson closed 1 year ago

nickdickinson commented 1 year ago

Following PR #27, the request is to offer a way to avoid the request to save the file while in interactive mode.

nickdickinson commented 1 year ago

In the next release, there is a global option that is a temporary workaround and allows one to avoid the interactive prompts to save the file: options(activityinfo.interactive = FALSE)

If you only want this set temporarily in a session that cleans up after the code is finished or an error occurs:

library(withr)
withr::with_options(list(activityinfo.interactive = FALSE), {
# Your ActivityInfo r code here
})

Eventually we would like an argument saveCredentials that if it is set to TRUE then it would save the credentials to a file and if FALSE it would not, otherwise if missing it would default to the normal interactive approach that current users know.

nickdickinson commented 1 year ago

Accidentally wrote TRUE but I have no edited the example above to FALSE for not asking interactively whether the file should be saved.

MatayoBweta commented 1 year ago

We should consider this functionality as ready?

nickdickinson commented 1 year ago

Yes, if you install the latest version from Github then it should work.

akbertram commented 1 year ago

@nickdickinson we can close this right?