Skip to content

Commit

Permalink
no longer require /usr/local/bin to be writable on macOS since I don'…
Browse files Browse the repository at this point in the history
…t know why sometimes the the /usr/bin/osascript hack doesn't work (#24)
  • Loading branch information
yihui committed Mar 5, 2019
1 parent 619af13 commit 4e902ba
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 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.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"),
Expand Down
8 changes: 4 additions & 4 deletions R/install.R
Original file line number Diff line number Diff line change
Expand Up @@ -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
)
}
Expand Down
6 changes: 3 additions & 3 deletions R/tlmgr.R
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down

0 comments on commit 4e902ba

Please sign in to comment.