Skip to content

Commit b695762

Browse files
authored
Avoid copying configured skipDirs (#18)
* dont copy configured skipDirs * dont update deps * use install
1 parent cd2bd5f commit b695762

File tree

3 files changed

+18
-5
lines changed

3 files changed

+18
-5
lines changed

Makefile

+5-5
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,11 @@ init:
2525
.PHONY: update-deps
2626
update-deps: mod-download
2727
mkdir -p $(DEPSGOBIN)
28-
PATH=$(DEPSGOBIN):$$PATH go get -u golang.org/x/tools/cmd/goimports
29-
PATH=$(DEPSGOBIN):$$PATH go get -u github.com/golang/protobuf/protoc-gen-go
30-
PATH=$(DEPSGOBIN):$$PATH go get -u github.com/envoyproxy/protoc-gen-validate
28+
PATH=$(DEPSGOBIN):$$PATH go install golang.org/x/tools/cmd/goimports
29+
PATH=$(DEPSGOBIN):$$PATH go install github.com/golang/protobuf/protoc-gen-go
3130
PATH=$(DEPSGOBIN):$$PATH go install github.com/envoyproxy/protoc-gen-validate
32-
PATH=$(DEPSGOBIN):$$PATH go get -u github.com/golang/mock/gomock
31+
PATH=$(DEPSGOBIN):$$PATH go install github.com/envoyproxy/protoc-gen-validate
32+
PATH=$(DEPSGOBIN):$$PATH go get github.com/golang/mock/gomock
3333
PATH=$(DEPSGOBIN):$$PATH go install github.com/golang/mock/mockgen
3434
PATH=$(DEPSGOBIN):$$PATH go install github.com/onsi/ginkgo/ginkgo
3535

@@ -63,4 +63,4 @@ run-tests:
6363
-progress \
6464
-race \
6565
-compilers=4 \
66-
-skipPackage=$(SKIP_PACKAGES) $(TEST_PKG)
66+
-skipPackage=$(SKIP_PACKAGES) $(TEST_PKG)

changelog/v0.0.5/skip-dirs.yaml

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
changelog:
2+
- type: FIX
3+
description: Don't copy configured skip directories.
4+
issueLink: https://github.com/solo-io/anyvendor/issues/17

pkg/manager/common.go

+9
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import (
66
"log"
77
"os"
88
"path/filepath"
9+
"strings"
910
"unicode"
1011

1112
"github.com/mattn/go-zglob"
@@ -112,6 +113,14 @@ func NewDefaultCopier() *copier {
112113
}
113114

114115
func (c *copier) Copy(src, dst string) (int64, error) {
116+
for _, skip := range c.skipDirs {
117+
if !strings.Contains(src, skip) {
118+
continue
119+
}
120+
// don't copy skip matches
121+
return 0, nil
122+
}
123+
115124
log.Printf("copying %v -> %v", src, dst)
116125

117126
if err := c.fs.MkdirAll(filepath.Dir(dst), os.ModePerm); err != nil {

0 commit comments

Comments
 (0)