Skip to content

Commit

Permalink
Properly handle go mod init failures. (#1052)
Browse files Browse the repository at this point in the history
  • Loading branch information
Marcin Owsiany authored and kensipe committed Nov 20, 2019
1 parent cdae026 commit 4113adb
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion hack/update_codegen.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,12 @@ if [ -d "$CODE_GEN_DIR" ]; then
echo "Using cached code generator version: $VERSION"
else
git clone https://github.com/kubernetes/code-generator.git "${CODE_GEN_DIR}"
cd "${CODE_GEN_DIR}" && git reset --hard "${VERSION}" && go mod init && cd -
cd "${CODE_GEN_DIR}"
git reset --hard "${VERSION}"
if [[ ! -f go.mod ]]; then
go mod init
fi
cd -
fi

"${CODE_GEN_DIR}"/generate-groups.sh \
Expand Down

0 comments on commit 4113adb

Please sign in to comment.