Merge pull request #171495 from microsoft/tyriar/hyphen_r

Use -r over -f in bash si script
This commit is contained in:
Daniel Imms 2023-01-17 07:54:20 -08:00 committed by GitHub
commit 4f3f8c3368
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -13,21 +13,21 @@ VSCODE_SHELL_INTEGRATION=1
# Run relevant rc/profile only if shell integration has been injected, not when run manually
if [ "$VSCODE_INJECTION" == "1" ]; then
if [ -z "$VSCODE_SHELL_LOGIN" ]; then
if [ -f ~/.bashrc ]; then
if [ -r ~/.bashrc ]; then
. ~/.bashrc
fi
else
# Imitate -l because --init-file doesn't support it:
# run the first of these files that exists
if [ -f /etc/profile ]; then
if [ -r /etc/profile ]; then
. /etc/profile
fi
# exceute the first that exists
if [ -f ~/.bash_profile ]; then
if [ -r ~/.bash_profile ]; then
. ~/.bash_profile
elif [ -f ~/.bash_login ]; then
elif [ -r ~/.bash_login ]; then
. ~/.bash_login
elif [ -f ~/.profile ]; then
elif [ -r ~/.profile ]; then
. ~/.profile
fi
builtin unset VSCODE_SHELL_LOGIN