Skip to content

Commit

Permalink
use ~/.local/bin as the system bin path of TeX Live if it exists, oth…
Browse files Browse the repository at this point in the history
…erwise still use ~/bin (#365)
  • Loading branch information
yihui committed Apr 14, 2022
1 parent 74267b7 commit 4f61968
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 5 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.38.2
Version: 0.38.3
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, PBC", role = "cph"),
Expand Down
6 changes: 3 additions & 3 deletions R/install.R
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ install_tinytex = function(
os,
'unix' = {
check_local_bin()
if (os_index != 3 && !dir_exists('~/bin')) on.exit(message(
if (os_index != 3 && !any(dir_exists(c('~/bin', '~/.local/bin')))) on.exit(message(
'You may have to restart your system after installing TinyTeX to make sure ',
'~/bin appears in your PATH variable (https://github.com/yihui/tinytex/issues/16).'
), add = TRUE)
Expand Down Expand Up @@ -411,8 +411,8 @@ install_prebuilt = function(
# post-install configurations
post_install_config = function(add_path, extra_packages, repo, hash = FALSE) {
if (os_index == 2) {
dir.create('~/bin', FALSE, TRUE)
tlmgr(c('option', 'sys_bin', '~/bin'))
if (!dir_exists(bin_dir <- '~/.local/bin')) dir.create(bin_dir <- '~/bin', FALSE, TRUE)
tlmgr(c('option', 'sys_bin', bin_dir))
}
# fix fonts.conf: https://github.com/yihui/tinytex/issues/313
tlmgr(c('postaction', 'install', 'script', 'xetex'), .quiet = TRUE)
Expand Down
8 changes: 7 additions & 1 deletion tools/install-bin-unix.sh
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,13 @@ else if [ $TINYTEX_INSTALLER != 'installer-unix' ]; then
fi

cd $TEXDIR/bin/*/
[ $OSNAME != "Darwin" ] && ./tlmgr option sys_bin ~/bin

BINDIR="$HOME/.local/bin"
if [ ! -d $BINDIR]; then
BINDIR="$HOME/bin"
fi

[ $OSNAME != "Darwin" ] && ./tlmgr option sys_bin $BINDIR
./tlmgr postaction install script xetex # GH issue #313
([ -z $CI ] || [ $(echo $CI | tr "[:upper:]" "[:lower:]") != "true" ]) && ./tlmgr option repository ctan
./tlmgr path add

0 comments on commit 4f61968

Please sign in to comment.