Skip to content

Commit

Permalink
build(tools): adjust bash script for MacOS builtin version (#9582)
Browse files Browse the repository at this point in the history
Signed-off-by: Jakub Dyszkiewicz <[email protected]>
Signed-off-by: Mike Beaumont <[email protected]>
Co-authored-by: Jakub Dyszkiewicz <[email protected]>
  • Loading branch information
michaelbeaumont and jakubdyszkiewicz authored Mar 12, 2024
1 parent 1c529b2 commit b5632a6
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
5 changes: 3 additions & 2 deletions tools/policy-gen/generate-policy-config.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,9 @@ policies=$(for i in "${@:2}"; do
fi
done)

read -ra policies_dir_components <<< "${POLICIES_DIR//\// }"
package_name=${policies_dir_components[-1]}
IFS="/" read -ra policies_dir_components <<< "${POLICIES_DIR}"
len=${#policies_dir_components[@]}
package_name=${policies_dir_components[len-1]}

echo "// Generated by tools/policy-gen
// Run \"make generate\" to update this file.
Expand Down
5 changes: 3 additions & 2 deletions tools/policy-gen/generate-policy-import.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,9 @@ mappings=$(for i in "${@:3}"; do
fi
done)

read -ra policies_dir_components <<< "${POLICIES_DIR//\// }"
package_name=${policies_dir_components[-1]}
IFS="/" read -ra policies_dir_components <<< "${POLICIES_DIR}"
len=${#policies_dir_components[@]}
package_name=${policies_dir_components[len-1]}

echo "// Generated by tools/policy-gen
// Run \"make generate\" to update this file.
Expand Down

0 comments on commit b5632a6

Please sign in to comment.