Skip to content

Commit

Permalink
generate stable sort output
Browse files Browse the repository at this point in the history
Signed-off-by: Sebastian Hoß <[email protected]>
  • Loading branch information
sebhoss committed Nov 4, 2023
1 parent 4f4b63d commit b664707
Show file tree
Hide file tree
Showing 137 changed files with 91,541 additions and 302 deletions.
8 changes: 3 additions & 5 deletions code-generator/generate.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@


### Generate code with kopium
for file in $(find ./crd-catalog -name '*.yaml' -type f); do
for file in $(find ./crd-catalog -name '*.yaml' -type f | LC_ALL=C sort --general-numeric-sort); do
crd=$(basename "${file%.*}")
version=$(basename "$(dirname "${file}")")
group=$(basename "$(dirname "$(dirname "${file}")")")
Expand All @@ -17,8 +17,6 @@ for file in $(find ./crd-catalog -name '*.yaml' -type f); do

if ! kopium --docs --filename "${file}" >"./kube-custom-resources-rs/src/${module}/${rust_crd}.rs"; then
echo "error in ${file}"
else
echo "pub mod ${rust_crd};" >>"./kube-custom-resources-rs/src/${module}/mod.rs"
fi
done

Expand Down Expand Up @@ -240,7 +238,7 @@ done

### Generate mod.rs files
find ./kube-custom-resources-rs/src -name mod.rs -type f -delete
for file in $(find ./crd-catalog -name '*.yaml' -type f); do
for file in $(find ./crd-catalog -name '*.yaml' -type f | LC_ALL=C sort --general-numeric-sort); do
crd=$(basename "${file%.*}")
version=$(basename "$(dirname "${file}")")
group=$(basename "$(dirname "$(dirname "${file}")")")
Expand All @@ -259,7 +257,7 @@ sed -i '/\[features\]/,$d' ./kube-custom-resources-rs/Cargo.toml
echo '[features]' >>./kube-custom-resources-rs/Cargo.toml
rm --force ./kube-custom-resources-rs/src/lib.rs

for mld in ./kube-custom-resources-rs/src/*; do
for mld in $(find ./kube-custom-resources-rs/src -type d | LC_ALL=C sort --general-numeric-sort); do
module=$(basename "${mld}")

if [ -f "${mld}/mod.rs" ]; then
Expand Down

Large diffs are not rendered by default.

Loading

0 comments on commit b664707

Please sign in to comment.