Skip to content

Commit 48174dd

Browse files
committed
✨ feat: pypi config
1 parent 6a3b99f commit 48174dd

File tree

3 files changed

+38
-4
lines changed

3 files changed

+38
-4
lines changed

host.mirrors

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
tencent|mirrors.cloud.tencent.com|腾讯软件源|https://mirrors.cloud.tencent.com|ubuntu,debian,docker,centos,maven
2-
163|mirrors.163.com|网易开源镜像站|https://mirrors.163.com|ubuntu,debian,centos,docker,maven
1+
tencent|mirrors.cloud.tencent.com|腾讯软件源|https://mirrors.cloud.tencent.com|ubuntu,debian,docker,centos,maven,pypi
2+
163|mirrors.163.com|网易开源镜像站|https://mirrors.163.com|ubuntu,debian,centos,docker,maven,pypi
33
ustc|mirrors.ustc.edu.cn|中国科学技术大学开源软件镜像|https://mirrors.ustc.edu.cn|ubuntu,debian,docker,centos-stream
4-
aliyun|mirrors.aliyun.com|阿里云镜像站|https://mirrors.aliyun.com|ubuntu,debian,docker,centos,centos-stream,maven
4+
aliyun|mirrors.aliyun.com|阿里云镜像站|https://mirrors.aliyun.com|ubuntu,debian,docker,centos,centos-stream,maven,pypi
55
tsinghua|mirrors.tuna.tsinghua.edu.cn|清华大学开源软件镜像站|https://mirrors.tuna.tsinghua.edu.cn|ubuntu,debian,docker,centos-stream
66
nju|mirror.nju.edu.cn|南京大学开源镜像站|https://mirror.nju.edu.cn|ubuntu,debian
77
sjtu|mirror.sjtu.edu.cn|上海交通大学开源镜像站|https://mirror.sjtu.edu.cn|ubuntu,debian,docker

pip.conf

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
[global]
2+
index-url = https://HOST/pypi/simple/
3+
4+
[install]
5+
trusted-host=HOST

tiny-shell.sh

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -205,6 +205,32 @@ maven(){
205205
cat ${repo_config} > ${destination}
206206
}
207207

208+
pypi(){
209+
210+
clear
211+
echo -e ""
212+
echo -e "${green}tiny-shell ${plain}Pip Setting"
213+
echo -e ${line}
214+
echo -e ""
215+
216+
mirrors_check pypi
217+
218+
repo_config="./pip.conf"
219+
destination="$HOME/.pip/pip.conf"
220+
221+
print_info
222+
mkdir -p $(dirname ${destination})
223+
224+
cat ${repo_config} > .target
225+
226+
sed -i "s/HOST/${host}/g" .target
227+
228+
cat .target > ${destination}
229+
230+
rm .target
231+
}
232+
233+
208234
menu(){
209235
clear
210236
echo -e ""
@@ -216,7 +242,7 @@ menu(){
216242
echo -e "tiny-shell - 显示帮助菜单"
217243
echo -e "tiny-shell system - 切换国内系统镜像源(阿里云/网易/清华大学)众多镜像站收录"
218244
echo -e "tiny-shell docker - 快速安装docker"
219-
echo -e "tiny-shell pip - 快速配置pip加速镜像"
245+
echo -e "tiny-shell pypi - 快速配置pip加速镜像"
220246
echo -e "tiny-shell maven - 快速配置maven加速镜像"
221247
echo -e ${line}
222248
echo -e ""
@@ -230,6 +256,9 @@ if [[ $# > 0 ]]; then
230256
"docker")
231257
root_check && docker
232258
;;
259+
"pypi")
260+
pypi
261+
;;
233262
"maven")
234263
maven
235264
;;

0 commit comments

Comments
 (0)