Skip to content

Commit

Permalink
provide a more informative message when /usr/local/bin is not writabl…
Browse files Browse the repository at this point in the history
…e on macOS (#38, #24)
  • Loading branch information
yihui committed May 2, 2018
1 parent 554bc0a commit f9aba40
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Package: tinytex
Type: Package
Title: Helper Functions to Install and Maintain 'TeX Live', and Compile 'LaTeX' Documents
Version: 0.5.3
Version: 0.5.4
Authors@R: c(
person("Yihui", "Xie", role = c("aut", "cre", "cph"), email = "[email protected]", comment = c(ORCID = "0000-0003-0645-5666")),
person(family = "RStudio, Inc.", role = "cph"),
Expand Down
8 changes: 7 additions & 1 deletion R/install.R
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,13 @@ install_tinytex = function(
'--no-admin', '--path', shQuote(repository), if (macos && https) 'tlgpg'
)
))
if (res != 0) stop('Failed to install TinyTeX', call. = FALSE)
if (res != 0) {
if (macos && file.access('/usr/local/bin', 2) != 0) message(
'The directory /usr/local/bin is not writable; ',
'see https://github.com/yihui/tinytex/issues/24 for more info.'
)
stop('Failed to install TinyTeX', call. = FALSE)
}
target = normalizePath(
if (macos) '~/Library/TinyTeX' else '~/.TinyTeX'
)
Expand Down

0 comments on commit f9aba40

Please sign in to comment.