Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
K
k3s
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jacklull
k3s
Commits
9ac09501
Commit
9ac09501
authored
Jul 14, 2017
by
Jeff Grafton
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add utility function to install go package at a particular commit
parent
ebf24c14
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
0 deletions
+17
-0
util.sh
hack/lib/util.sh
+17
-0
No files found.
hack/lib/util.sh
View file @
9ac09501
...
@@ -513,6 +513,23 @@ kube::util::ensure_godep_version() {
...
@@ -513,6 +513,23 @@ kube::util::ensure_godep_version() {
godep version
godep version
}
}
# Installs the specified go package at a particular commit.
kube::util::go_install_from_commit
()
{
local
-r
pkg
=
$1
local
-r
commit
=
$2
kube::util::ensure-temp-dir
mkdir
-p
"
${
KUBE_TEMP
}
/go/src"
GOPATH
=
"
${
KUBE_TEMP
}
/go"
go get
-d
-u
"
${
pkg
}
"
2>/dev/null
(
cd
"
${
KUBE_TEMP
}
/go/src/
${
pkg
}
"
git checkout
-q
"
${
commit
}
"
GOPATH
=
"
${
KUBE_TEMP
}
/go"
go
install
"
${
pkg
}
"
)
PATH
=
"
${
KUBE_TEMP
}
/go/bin:
${
PATH
}
"
hash
-r
# force bash to clear PATH cache
}
# Checks that the GOPATH is simple, i.e. consists only of one directory, not multiple.
# Checks that the GOPATH is simple, i.e. consists only of one directory, not multiple.
kube::util::ensure_single_dir_gopath
()
{
kube::util::ensure_single_dir_gopath
()
{
if
[[
"
${
GOPATH
}
"
==
*
:
*
]]
;
then
if
[[
"
${
GOPATH
}
"
==
*
:
*
]]
;
then
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment