File tree Expand file tree Collapse file tree 2 files changed +13
-10
lines changed Expand file tree Collapse file tree 2 files changed +13
-10
lines changed Original file line number Diff line number Diff line change 1
1
#! /bin/bash
2
- export http_proxy=http://xxx.xxx.xxx.xxx:80/
3
- export ftp_proxy=ftp://xxx.xxx.xxx.xxx:80/
4
- export socks_proxy=socks://xxx.xxx.xxx.xxx:80/
5
- export https_proxy=https://xxx.xxx.xxx.xxx:80/
2
+ export http_proxy=http://xxxx.xxxx.xxxx.xxxx:80/
3
+ export ftp_proxy=ftp://xxxx.xxxx.xxxx.xxxx:80/
4
+ export socks_proxy=socks://xxxx.xxxx.xxxx.xxxx:80/
5
+ export https_proxy=https://xxxx.xxxx.xxxx.xxxx:80/
6
+
7
+ SED=$( test $( uname -o) = ' Darwin' && echo gsed || echo sed)
6
8
7
9
if [ -z $( git config --global --name-only -l | grep remote.origin.proxy | xargs) ]
8
10
then
9
11
git config --global --add remote.origin.proxy " "
10
12
fi
11
- gsed -i ' s/proxy.*/proxy = xxx\.xxx\.xxx\.xxx :80/' ~ /.gitconfig
13
+ $SED -i ' s/proxy.*/proxy = xxxx\.xxxx\.xxxx\.xxxx :80/' ~ /.gitconfig
12
14
13
15
if [ -z $( git config --global --name-only -l | grep user.name | xargs) ]
14
16
then
15
17
git config --global --add user.name " "
16
18
fi
17
- gsed -i ' s/name.*/name = xxxxx /' ~ /.gitconfig
19
+ $SED -i ' s/name.*/name = xxxx /' ~ /.gitconfig
18
20
19
21
if [ -z $( git config --global --name-only -l | grep user.email | xargs) ]
20
22
then
21
23
git config --global --add user.email " "
22
24
fi
23
- gsed -i ' s/email.*/email = xxxxx @xxxx.xxx /' ~ /.gitconfig
25
+ $SED -i ' s/email.*/email = xxxx @xxxx.xxxx /' ~ /.gitconfig
Original file line number Diff line number Diff line change 1
1
#! /bin/bash
2
+ SED=$( test $( uname -o) = ' Darwin' && echo gsed || echo sed)
2
3
unset http_proxy ftp_proxy socks_proxy https_proxy
3
4
if [ -z $( git config --global --name-only -l | grep remote.origin.proxy | xargs) ]
4
5
then
5
6
git config --global --add remote.origin.proxy " "
6
7
fi
7
- gsed -i ' s/proxy *= *[0-9.:]*/proxy =/' ~ /.gitconfig
8
+ $SED -i ' s/proxy *= *[0-9.:]*/proxy =/' ~ /.gitconfig
8
9
9
10
if [ -z $( git config --global --name-only -l | grep user.name | xargs) ]
10
11
then
11
12
git config --global --add user.name " "
12
13
fi
13
- gsed -i ' s/name.*/name = xxxx/' ~ /.gitconfig
14
+ $SED -i ' s/name.*/name = xxxx/' ~ /.gitconfig
14
15
15
16
if [ -z $( git config --global --name-only -l | grep user.email | xargs) ]
16
17
then
17
18
git config --global --add user.email " "
18
19
fi
19
- gsed -i ' s/email.*/email = xxxx@xxx /' ~ /.gitconfig
20
+ $SED -i ' s/email.*/email = xxxx@xxxx /' ~ /.gitconfig
You can’t perform that action at this time.
0 commit comments