update set/unset git proxy command

This commit is contained in:
2023-02-19 21:39:41 +08:00
parent 74c4fcae18
commit 8fc7f3df49
3 changed files with 27 additions and 8 deletions

View File

@@ -10,8 +10,8 @@
# past this point for scp and rcp, and it's important to refrain from # past this point for scp and rcp, and it's important to refrain from
# outputting anything in those cases. # outputting anything in those cases.
if [[ $- != *i* ]] ; then if [[ $- != *i* ]] ; then
# Shell is non-interactive. Be done now! # Shell is non-interactive. Be done now!
return return
fi fi
@@ -19,11 +19,11 @@ fi
HISTCONTROL=ignoreboth HISTCONTROL=ignoreboth
#export PATH="~/.local/bin:/usr/lib/distcc/bin:${PATH}" #export PATH="~/.local/bin:/usr/lib/distcc/bin:${PATH}"
export PATH="/usr/lib/ccache/bin${PATH:+:}$PATH" # export PATH="~/.local/bin/:/usr/lib/ccache/bin${PATH:+:}$PATH"
export CCACHE_DIR="/var/cache/ccache" # export CCACHE_DIR="/var/cache/ccache"
export GPG_TTY=$(tty) export GPG_TTY=$(tty)
# export PATH="~/.local/bin${PATH:+:}$PATH" export PATH="~/.local/bin${PATH:+:}$PATH"
alias ll="ls -l" alias ll="ls -l"
alias la="ls -a" alias la="ls -a"
@@ -42,11 +42,27 @@ unset-proxy() {
} }
set-git-proxy() { set-git-proxy() {
git config --global http.proxy 127.0.0.1:8118 prefix_cmd=""
flag="--global"
if [[ "$1" == "-s" ]]; then
prefix_cmd="sudo"
flag="--system"
fi
$prefix_cmd git config $flag http.proxy http://127.0.0.1:8118
$prefix_cmd git config $flag http.sslVerify false
} }
unset-git-proxy() { unset-git-proxy() {
git config --global --unset http.proxy prefix_cmd=""
flag="--global"
if [[ "$1" == "-s" ]]; then
prefix_cmd="sudo"
flag="--system"
fi
$prefix_cmd git config $flag --unset http.proxy
$prefix_cmd git config $flag --unset http.sslVerify
} }
set-npm-proxy() { set-npm-proxy() {
@@ -74,3 +90,6 @@ alias pip='function _pip() {
export PNPM_HOME="/home/zedhugh/.local/share/pnpm" export PNPM_HOME="/home/zedhugh/.local/share/pnpm"
export PATH="$PNPM_HOME:$PATH" export PATH="$PNPM_HOME:$PATH"
# pnpm end # pnpm end
# tabtab source for packages
# uninstall by removing these lines
[ -f ~/.config/tabtab/bash/__tabtab.bash ] && . ~/.config/tabtab/bash/__tabtab.bash || true

View File

@@ -16,7 +16,7 @@ fcitx5 -d
#export QT_IM_MODULE="ibus" #export QT_IM_MODULE="ibus"
#ibus-daemon -drx #ibus-daemon -drx
xcompmgr & # xcompmgr &
# nm-applet & # nm-applet &
#fcitx -d & > /dev/null #fcitx -d & > /dev/null

0
script/screenshot Normal file → Executable file
View File