File tree Expand file tree Collapse file tree 1 file changed +13
-4
lines changed Expand file tree Collapse file tree 1 file changed +13
-4
lines changed Original file line number Diff line number Diff 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"
9798export 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+
101101pipenv_Keyword=' export PATH=~/.local/bin:$PATH'
102102
103103case $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
133142fi
134143
135144Ask_yn " Do you want to install pipenv?" ; result=$?
You can’t perform that action at this time.
0 commit comments