Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

install-unx.sh change the current working dir after execution #386

Closed
cderv opened this issue Sep 19, 2022 · 2 comments
Closed

install-unx.sh change the current working dir after execution #386

cderv opened this issue Sep 19, 2022 · 2 comments

Comments

@cderv
Copy link
Contributor

cderv commented Sep 19, 2022

cd $PREVWD
# finished base
cd $OLDPWD
rm -r install-tl-*
$TEXDIR/bin/*/tlmgr install $(download https://yihui.org/gh/tinytex/tools/pkgs-custom.txt | tr '\n' ' ')
if [ "$1" = '--admin' ]; then
if [ "$2" != '--no-path' ]; then
sudo $TEXDIR/bin/*/tlmgr path add
fi
else
$TEXDIR/bin/*/tlmgr path add || true
fi

Aren't we missing a cd $PREVWD also at the end ?

I am running this on a new Linux environment, and after the installation I am in /tmp while I was not at the start.

@yihui Just wondering before doing the modification

@yihui
Copy link
Member

yihui commented Sep 19, 2022

It depends on how you run the script. If you run it via sh install-unx.sh, it won't matter (the change of working directory is only transient and will be restored after sh is done). If you run the script line by line interactively in the shell, yes, the change of working directory will be permanent, as you could expect.

That said, I guess adding cd $PREVWD to the end should be fine.

@cderv
Copy link
Contributor Author

cderv commented Sep 19, 2022

It depends on how you run the script. If you run it via sh install-unx.sh, it won't matter

Oh I see. I run it like that

. install-unx.sh

which execute in current environment and not another one.

@yihui yihui closed this as completed in 5302d0e Jan 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants