File tree Expand file tree Collapse file tree 1 file changed +26
-7
lines changed Expand file tree Collapse file tree 1 file changed +26
-7
lines changed Original file line number Diff line number Diff line change @@ -48,10 +48,6 @@ SKIP_FETCH_TOOLS=${SKIP_FETCH_TOOLS:-""}
48
48
49
49
# fetch k8s API gen tools and make it available under kb_root_dir/bin.
50
50
function fetch_kb_tools {
51
- if [ -n " $SKIP_FETCH_TOOLS " ]; then
52
- return 0
53
- fi
54
-
55
51
header_text " fetching tools"
56
52
kb_tools_archive_name=" kubebuilder-tools-$k8s_version -$goos -$goarch .tar.gz"
57
53
kb_tools_download_url=" https://storage.googleapis.com/kubebuilder-tools/$kb_tools_archive_name "
@@ -63,11 +59,34 @@ function fetch_kb_tools {
63
59
tar -zvxf " $kb_tools_archive_path " -C " $tmp_root /"
64
60
}
65
61
62
+ function is_installed {
63
+ if [ command -v $1 & > /dev/null ]; then
64
+ return 0
65
+ fi
66
+ return 1
67
+ }
68
+
69
+ function fetch_go_tools {
70
+ header_text " Checking for gometalinter.v2"
71
+ if ! is_installed gometalinter.v2; then
72
+ header_text " Installing gometalinter.v2"
73
+ go get -u gopkg.in/alecthomas/gometalinter.v2 && gometalinter.v2 --install
74
+ fi
75
+
76
+ header_text " Checking for dep"
77
+ if ! is_installed dep; then
78
+ header_text " Installing dep"
79
+ go get -u github.com/golang/dep/cmd/dep
80
+ fi
81
+ }
82
+
66
83
header_text " using tools"
67
84
68
- which gometalinter.v2
69
- which dep
70
- fetch_kb_tools
85
+ if [ -z " $SKIP_FETCH_TOOLS " ]; then
86
+ fetch_go_tools
87
+ fetch_kb_tools
88
+ fi
89
+
71
90
setup_envs
72
91
73
92
${hack_dir} /verify.sh
You can’t perform that action at this time.
0 commit comments