зеркало из https://github.com/Azure/AzureGraph.git
use askYesNo, update news
This commit is contained in:
Родитель
f95de49edc
Коммит
62e017aea0
|
@ -1,6 +1,6 @@
|
|||
Package: AzureGraph
|
||||
Title: Simple Interface to 'Microsoft Graph'
|
||||
Version: 1.0.3.9000
|
||||
Version: 1.0.4
|
||||
Authors@R: c(
|
||||
person("Hong", "Ooi", , "hongooi@microsoft.com", role = c("aut", "cre")),
|
||||
person("Microsoft", role="cph")
|
||||
|
|
6
NEWS.md
6
NEWS.md
|
@ -1,6 +1,8 @@
|
|||
# AzureGraph 1.0.3.9000
|
||||
# AzureGraph 1.0.4
|
||||
|
||||
- Minor bug fixes.
|
||||
- Allow Azure Active Directory (AAD) v2.0 tokens to be used for authenticating. Note that AAD v1.0 is still the default and recommended version.
|
||||
- Use `utils::askYesNo` for confirmation prompts on R >= 3.5, eg when deleting objects; this fixes a bug in reading the input. As a side-effect, Windows users who are using RGUI.exe will see a popup dialog box instead of a message in the terminal.
|
||||
- Various other bug fixes.
|
||||
|
||||
# AzureGraph 1.0.3
|
||||
|
||||
|
|
|
@ -63,10 +63,9 @@ public=list(
|
|||
{
|
||||
if(confirm && interactive())
|
||||
{
|
||||
msg <- sprintf("Do you really want to delete the %s '%s'? (y/N) ",
|
||||
msg <- sprintf("Do you really want to delete the %s '%s'?",
|
||||
self$type, self$properties$displayName)
|
||||
yn <- readline(msg)
|
||||
if(tolower(substr(yn, 1, 1)) != "y")
|
||||
if(!get_confirmation(msg, FALSE))
|
||||
return(invisible(NULL))
|
||||
}
|
||||
|
||||
|
|
|
@ -157,3 +157,18 @@ is_empty <- function(x)
|
|||
length(x) == 0
|
||||
}
|
||||
|
||||
|
||||
# display confirmation prompt, return TRUE/FALSE (no NA)
|
||||
get_confirmation <- function(msg, default=TRUE)
|
||||
{
|
||||
ok <- if(getRversion() < numeric_version("3.5.0"))
|
||||
{
|
||||
msg <- paste(msg, if(default) "(Yes/no/cancel) " else "(yes/No/cancel) ")
|
||||
yn <- readline(msg)
|
||||
if(nchar(yn) == 0)
|
||||
default
|
||||
else tolower(substr(yn, 1, 1)) == "y"
|
||||
}
|
||||
else utils::askYesNo(msg, default)
|
||||
isTRUE(ok)
|
||||
}
|
||||
|
|
|
@ -182,10 +182,8 @@ delete_graph_login <- function(tenant="common", confirm=TRUE)
|
|||
if(confirm && interactive())
|
||||
{
|
||||
msg <- paste0("Do you really want to delete the Microsoft Graph login(s) for ",
|
||||
format_tenant(tenant), "? (y/N) ")
|
||||
|
||||
yn <- readline(msg)
|
||||
if(tolower(substr(yn, 1, 1)) != "y")
|
||||
format_tenant(tenant), "?")
|
||||
if(!get_confirmation(msg, FALSE))
|
||||
return(invisible(NULL))
|
||||
}
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче