Skip to content

Commit

Permalink
Long path help msg in non-en locales
Browse files Browse the repository at this point in the history
The error string is different in this case.
Improves #84.
  • Loading branch information
gaborcsardi committed Oct 3, 2018
1 parent deebb19 commit 9b5f7a7
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion R/install.R
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,8 @@ safe_build_package <- function(pkgdir, build_opts, dest_path, quiet, use_pkgbuil

msg_for_long_paths <- function(output) {
if (sys_type() == "windows" &&
any(grepl("over-long path length", output$stderr))) {
(r_error_matches("over-long path", output$stderr) ||
r_error_matches("over-long path length", output$stderr))) {
message(
"\nIt seems that this package contains files with very long paths.\n",
"This is not supported on most Windows versions. Please contact the\n",
Expand All @@ -124,6 +125,11 @@ msg_for_long_paths <- function(output) {
}
}

r_error_matches <- function(msg, str) {
any(grepl(msg, str)) ||
any(grepl(gettext(msg, domain = "R"), str))
}

#' Install package dependencies if needed.
#'
#' @inheritParams package_deps
Expand Down

0 comments on commit 9b5f7a7

Please sign in to comment.