Skip to content

Commit

Permalink
Merge pull request openshift#2183 from zhiweiyin318/fix-updata-codegen
Browse files Browse the repository at this point in the history
fix vendor is not put back and failed on MAC env after run update-codegen.sh
  • Loading branch information
openshift-merge-bot[bot] committed Jan 23, 2024
2 parents 69c024e + 95149d4 commit 35373d8
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions hack/update-codegen.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,16 @@
SCRIPT_ROOT=$(dirname ${BASH_SOURCE})/..
CODEGEN_PKG=${CODEGEN_PKG:-$(cd ${SCRIPT_ROOT}; ls -d -1 ./vendor/k8s.io/code-generator 2>/dev/null || echo ../../../k8s.io/code-generator)}

# use gsed for MAC env
SED_CMD=sed
if [[ `uname` == 'Darwin' ]]; then
SED_CMD=gsed
fi

# HACK: For some reason this script is not executable.
sed -i 's,^exec \(.*/generate-internal-groups.sh\),bash \1,g' ${CODEGEN_PKG}/generate-groups.sh
${SED_CMD} -i 's,^exec \(.*/generate-internal-groups.sh\),bash \1,g' ${CODEGEN_PKG}/generate-groups.sh
# ...but we have to put it back, or `verify` will puke.
trap "git checkout ${CODEGEN_PKG}/generate-internal-groups.sh" EXIT
trap "git checkout ${CODEGEN_PKG}/generate-groups.sh" EXIT

cd "${SCRIPT_ROOT}"

Expand Down

0 comments on commit 35373d8

Please sign in to comment.