Skip to content

Commit 5162176

Browse files
authored
Put flag --no-proxy into the config (#291)
1 parent 3611056 commit 5162176

File tree

4 files changed

+3
-3
lines changed

4 files changed

+3
-3
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ fmt:
1717
go fmt ./...
1818

1919
lint:
20-
golint -set_exit_status=1 ./...
20+
golangci-lint run ./...
2121

2222
copy: build
2323
sudo cp bin/hd /usr/local/bin/

cmd/install.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ Cannot find your desired package? Please run command: hd fetch --reset, then try
6161
"Clean the package if the installation is success")
6262
flags.IntVarP(&opt.Thread, "thread", "t", viper.GetInt("thread"),
6363
`Download file with multi-threads. It only works when its value is bigger than 1`)
64-
flags.BoolVarP(&opt.NoProxy, "no-proxy", "", false, "Indicate no HTTP proxy taken")
64+
flags.BoolVarP(&opt.NoProxy, "no-proxy", "", viper.GetBool("no-proxy"), "Indicate no HTTP proxy taken")
6565
flags.BoolVarP(&opt.KeepPart, "keep-part", "", false,
6666
"If you want to keep the part files instead of deleting them")
6767
flags.StringVarP(&opt.OS, "os", "", runtime.GOOS, "The OS of target binary file")

cmd/root.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ func loadConfig() (err error) {
4545
viper.SetDefault("provider", ProviderGitHub)
4646
viper.SetDefault("fetch", false)
4747
viper.SetDefault("goget", false)
48+
viper.SetDefault("no-proxy", false)
4849

4950
thread := runtime.NumCPU()
5051
if thread > 4 {

go.mod

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ require (
1010
github.com/gosuri/uiprogress v0.0.1
1111
github.com/h2non/gock v1.0.9
1212
github.com/linuxsuren/cobra-extension v0.0.16
13-
github.com/magiconair/properties v1.8.5
1413
github.com/mitchellh/go-homedir v1.1.0
1514
github.com/nbio/st v0.0.0-20140626010706-e9e8d9816f32 // indirect
1615
github.com/onsi/ginkgo v1.16.5

0 commit comments

Comments
 (0)