summaryrefslogtreecommitdiff
path: root/hack/lib/util.sh
diff options
context:
space:
mode:
authorgy95 <guoyao17@huawei.com>2022-05-19 15:22:01 +0800
committergy95 <guoyao17@huawei.com>2022-05-19 15:33:01 +0800
commit70eb6610d8811dc53fe1994806cf1d65f0addc2b (patch)
tree2c1cb145d415ac64cb8ee928fac8236cbb36719e /hack/lib/util.sh
parentMerge pull request #3856 from ModeEngage/master (diff)
downloadkubeedge-70eb6610d8811dc53fe1994806cf1d65f0addc2b.tar.gz
codegen update in repository
Signed-off-by: gy95 <guoyao17@huawei.com>
Diffstat (limited to 'hack/lib/util.sh')
-rwxr-xr-xhack/lib/util.sh15
1 files changed, 15 insertions, 0 deletions
diff --git a/hack/lib/util.sh b/hack/lib/util.sh
index 3d73ab47d..d49d012e2 100755
--- a/hack/lib/util.sh
+++ b/hack/lib/util.sh
@@ -74,3 +74,18 @@ function kube::util::md5() {
md5sum "$1" | awk '{ print $1 }'
fi
}
+
+# util::create_gopath_tree create the GOPATH tree
+# Parameters:
+# - $1: the root path of repo
+# - $2: go path
+function util:create_gopath_tree() {
+ local repo_root=$1
+ local go_path=$2
+ local go_pkg_dir="${go_path}/src/github.com/kubeedge/kubeedge"
+ go_pkg_dir=$(dirname "${go_pkg_dir}")
+ mkdir -p "${go_pkg_dir}"
+ if [[ ! -e "${go_pkg_dir}" || "$(readlink "${go_pkg_dir}")" != "${repo_root}" ]]; then
+ ln -snf "${repo_root}" "${go_pkg_dir}"
+ fi
+}