Skip to content

Commit 502b359

Browse files
committed
Merge branch 'develop' into main
pyenv environment configuration is upgrade.
2 parents 9888930 + a66e101 commit 502b359

File tree

1 file changed

+13
-4
lines changed

1 file changed

+13
-4
lines changed

language_package.sh

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -93,21 +93,23 @@ function Ask_yn(){
9393
#====================================================
9494
# Part 2. Main
9595
#====================================================
96-
pyenv_Keyword='export PYENV_ROOT="$HOME/.pyenv"
96+
pyenv_Keyword='eval "$(pyenv init -)"'
97+
pyenv_Keyword_login='export PYENV_ROOT="$HOME/.pyenv"
9798
export PATH="$PYENV_ROOT/bin:$PATH"
98-
if command -v pyenv 1>/dev/null 2>&1; then
99-
eval "$(pyenv init -)"
100-
fi'
99+
eval "$(pyenv init --path)"'
100+
101101
pipenv_Keyword='export PATH=~/.local/bin:$PATH'
102102

103103
case $SHELL in
104104
*zsh )
105105
shell=zsh
106106
profile=~/.zshrc
107+
login_profile=~/.zprofile
107108
;;
108109
*bash )
109110
shell=bash
110111
profile=~/.bashrc
112+
login_profile=~/.bash_profile
111113
;;
112114
*ksh )
113115
shell=ksh
@@ -130,6 +132,13 @@ if [ $result = 1 ]; then
130132
# config profile
131133
printf "\n# pyenv setting\n$pyenv_Keyword\n" >> $profile
132134
fi
135+
136+
if [ "$(grep -xn "$pyenv_Keyword_login" $profile_login)" != "" ]; then
137+
Echo_Color g "You have already added pyenv config in $profile_login !!"
138+
else
139+
# config login_profile
140+
printf "\n# pyenv setting\n$pyenv_Keyword_login\n" >> $login_profile
141+
fi
133142
fi
134143

135144
Ask_yn "Do you want to install pipenv?"; result=$?

0 commit comments

Comments
 (0)