This commit is contained in:
Hong Ooi 2019-09-13 18:01:33 +10:00
Родитель f95de49edc
Коммит 62e017aea0
5 изменённых файлов: 24 добавлений и 10 удалений

Просмотреть файл

@ -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")

Просмотреть файл

@ -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))
}