Skip to content

Commit

Permalink
fix codegen.sh to work on macOS (#811)
Browse files Browse the repository at this point in the history
Signed-off-by: Bala.FA <bala@minio.io>
  • Loading branch information
balamurugana committed Jul 18, 2023
1 parent 530fe5d commit 136b8ac
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion codegen.sh
Expand Up @@ -63,7 +63,12 @@ find . -name "*.go.in" | while read -r infile; do
outfile="${infile%.in}"
sed -e "s:{VERSION}:${VERSIONS[-1]}:g" -e "s:{CAPSVERSION}:${VERSIONS[-1]^}:g" \
"${infile}" > "${outfile}"
sed -i -e '/^package/i // AUTO GENERATED CODE. DO NOT EDIT.\n' "${outfile}"
case "${OSTYPE}" in
darwin*) sed -i '' -e '/^package/i \
// AUTO GENERATED CODE. DO NOT EDIT.\
' "${outfile}" ;;
*) sed -i -e '/^package/i // AUTO GENERATED CODE. DO NOT EDIT.\n' "${outfile}" ;;
esac
done

# Prefix ${REPOSITORY}/pkg/apis/directpv.min.io to each versions.
Expand Down

0 comments on commit 136b8ac

Please sign in to comment.