Skip to content

Commit f0a2860

Browse files
committed
[rm][rename][mod]
rm: nvm_setup.sh, pyenv_setup.sh, features of those two scripts are merge to language_package.sh renmae: anguage_contral_package.sh -> custom_funciton.sh mod: language_package.sh, use this script can install pyenv, pipenv, nvm.
1 parent d0fa368 commit f0a2860

File tree

3 files changed

+34
-156
lines changed

3 files changed

+34
-156
lines changed

language_contral_package.sh renamed to custom_funciton.sh

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
# Print script help
2626
function show_script_help(){
2727
echo
28-
head -17 $0 | # find this file top 16 lines.
28+
head -21 $0 | # find this file top 16 lines.
2929
grep "^#[-|>]" | # show the line that include "#-" or "#>".
3030
sed -e "s/^#[-|>]*//1" # use nothing to replace "#-" or "#>" that the first keyword in every line.
3131
echo
@@ -172,4 +172,5 @@ for key in ${!funcs_info[*]}; do
172172
fi
173173
done
174174

175-
Echo_Color g "Done config!!"
175+
source $profile
176+
Echo_Color g "Done!! $0"

pyenv_setup.sh renamed to language_package.sh

Lines changed: 31 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,15 @@
11
#!/usr/bin/env bash
2-
#> +----------------------+
3-
#> | pyenv_setup.sh |
4-
#> +----------------------+
2+
#> +---------------------------+
3+
#> | language_package.sh |
4+
#> +---------------------------+
55
#-
66
#- SYNOPSIS
77
#-
8-
#- ./pyenv_setup.sh [-h]
8+
#- ./language_package.sh [-h]
9+
#-
10+
#- It will intatll Language Packages below:
11+
#- Python : pyenv, pipenv
12+
#- NodeJS : nvm
913
#-
1014
#- OPTIONS
1115
#-
@@ -14,15 +18,15 @@
1418
#-
1519
#- EXAMPLES
1620
#-
17-
#- $ ./pyenv_setup.sh -y
21+
#- $ ./language_package.sh -y
1822

1923
#====================================================
2024
# Part 1. Option Tool
2125
#====================================================
2226
# Print script help
2327
function show_script_help(){
2428
echo
25-
head -17 $0 | # find this file top 16 lines.
29+
head -22 $0 | # find this file top 16 lines.
2630
grep "^#[-|>]" | # show the line that include "#-" or "#>".
2731
sed -e "s/^#[-|>]*//1" # use nothing to replace "#-" or "#>" that the first keyword in every line.
2832
echo
@@ -89,7 +93,7 @@ function Ask_yn(){
8993
#====================================================
9094
# Part 2. Main
9195
#====================================================
92-
Keyword='export PYENV_ROOT="$HOME/.pyenv"
96+
pyenv_Keyword='export PYENV_ROOT="$HOME/.pyenv"
9397
export PATH="$PYENV_ROOT/bin:$PATH"
9498
if command -v pyenv 1>/dev/null 2>&1; then
9599
eval "$(pyenv init -)"
@@ -111,21 +115,31 @@ case $SHELL in
111115
Echo_Color r "Unknow shell, need to manually add pyenv config on your shell profile!!"
112116
;;
113117
esac
114-
# sudo apt-get install -y make build-essential libssl-dev zlib1g-dev libbz2-dev libreadline-dev libsqlite3-dev wget curl llvm libncurses5-dev libncursesw5-dev xz-utils tk-dev libffi-dev liblzma-dev python-openssl git
115-
sudo apt-get update
116-
sudo apt-get install --no-install-recommends make build-essential libssl-dev zlib1g-dev libbz2-dev libreadline-dev libsqlite3-dev wget curl llvm libncurses5-dev xz-utils tk-dev libxml2-dev libxmlsec1-dev libffi-dev liblzma-dev
117-
git clone https://github.com/pyenv/pyenv.git ~/.pyenv
118118

119-
# config profile
120-
Ask_yn "Do you want automatic add pyenv config?"; result=$?
119+
Ask_yn "Do you want to install pyenv"; result=$?
121120
if [ $result = 1 ]; then
122-
if grep -xn "$Keyword" $profile; then
121+
sudo apt-get update
122+
sudo apt-get install --no-install-recommends make build-essential libssl-dev zlib1g-dev libbz2-dev libreadline-dev libsqlite3-dev wget curl llvm libncurses5-dev xz-utils tk-dev libxml2-dev libxmlsec1-dev libffi-dev liblzma-dev
123+
git clone https://github.com/pyenv/pyenv.git ~/.pyenv
124+
125+
if [ "$(grep -xn "$pyenv_Keyword" $profile)" != "" ]; then
123126
Echo_Color g "You have already added pyenv config in $profile !!"
124127
else
125-
printf "\n# pyenv setting\n$Keyword\n" >> $profile
128+
# config profile
129+
printf "\n# pyenv setting\n$pyenv_Keyword\n" >> $profile
126130
fi
127-
Echo_Color g "Done config!!"
128-
source $profile
129131
fi
130132

133+
Ask_yn "Do you want to install pipenv?"; result=$?
134+
if [ $result = 1 ]; then
135+
pip install pipenv
136+
fi
137+
138+
Ask_yn "Do you want to install nvm?"; result=$?
139+
if [ $result = 1 ]; then
140+
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.0/install.sh | $shell
141+
fi
142+
143+
144+
source $profile
131145
Echo_Color g "Done!! $0"

nvm_setup.sh

Lines changed: 0 additions & 137 deletions
This file was deleted.

0 commit comments

Comments
 (0)