diff --git a/DESCRIPTION b/DESCRIPTION index a8f123215..cfd9f267a 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,7 +1,7 @@ Package: tinytex Type: Package Title: Helper Functions to Install and Maintain 'TeX Live', and Compile 'LaTeX' Documents -Version: 0.10.10 +Version: 0.10.11 Authors@R: c( person("Yihui", "Xie", role = c("aut", "cre", "cph"), email = "xie@yihui.name", comment = c(ORCID = "0000-0003-0645-5666")), person(family = "RStudio, Inc.", role = "cph"), diff --git a/R/install.R b/R/install.R index 769931e9c..afc4c7125 100644 --- a/R/install.R +++ b/R/install.R @@ -93,13 +93,13 @@ install_tinytex = function( if (macos && file.access('/usr/local/bin', 2) != 0) { chown_cmd = 'chown -R `whoami`:admin /usr/local/bin' message( - 'The directory /usr/local/bin is not writable. I need your admin privilege ', - 'to make it writable. See https://github.com/yihui/tinytex/issues/24 for more info.' + 'The directory /usr/local/bin is not writable. I recommend that you ', + 'make it writable. See https://github.com/yihui/tinytex/issues/24 for more info.' ) if (system(sprintf( "/usr/bin/osascript -e 'do shell script \"%s\" with administrator privileges'", chown_cmd - )) != 0) stop( - "Please run this command in your Terminal and retry installing TinyTeX:\n sudo ", + )) != 0) warning( + "Please run this command in your Terminal (password required):\n sudo ", chown_cmd, call. = FALSE ) } diff --git a/R/tlmgr.R b/R/tlmgr.R index 8698048e0..2009ef7dc 100644 --- a/R/tlmgr.R +++ b/R/tlmgr.R @@ -47,15 +47,15 @@ tlmgr = function(args = character(), usermode = FALSE, ..., .quiet = FALSE) { # add ~/bin to PATH if necessary on Linux, because sometimes PATH may not be # inherited (https://github.com/rstudio/rstudio/issues/1878), and TinyTeX is # installed to ~/bin by default; on Windows, prioritize win_app_dir('TinyTeX') -# if it exists (so TinyTeX can be used even when MiKTeX is installed) +# if it exists (so TinyTeX can be used even when MiKTeX is installed); on macOS, +# check if it is necessary to add ~/Library/TinyTeX/bin/*/ to PATH #' @importFrom xfun is_linux is_unix is_macos is_windows with_ext tweak_path = function() { - if (is_macos()) return() # assume symlinks were created under /usr/local/bin # check if ~/bin/tlmgr exists (created by TinyTeX by default) f = if (is_linux()) '~/bin/tlmgr' else if (is_windows()) { win_app_dir('TinyTeX', 'bin', 'win32', 'tlmgr.bat', error = FALSE) - } else return() + } else if (is_macos()) '~/Library/TinyTeX/bin/x86_64-darwin/tlmgr' else return() if (!file_test('-x', f)) f = getOption('tinytex.tlmgr.path', '') if (!file_test('-x', f)) return() bin = normalizePath(dirname(f))