Skip to content

Instantly share code, notes, and snippets.

@babarot
Created February 28, 2020 04:00
Show Gist options
  • Save babarot/e6190627a17d81ccd697a8de9c7a8db6 to your computer and use it in GitHub Desktop.
Save babarot/e6190627a17d81ccd697a8de9c7a8db6 to your computer and use it in GitHub Desktop.
migrate rego file
for policy in $@
do
if [[ $policy == *_test.rego ]]; then
continue
fi
if [[ $policy == *.rego ]]; then
file=${policy##*/}
mkdir -p .policy/rego/prc/"${file%*.rego}"
git mv $policy .policy/rego/prc/"${file%*.rego}"/src.rego
git mv ${policy%*.rego}_test.rego .policy/rego/prc/"${file%*.rego}"/src_test.rego
fi
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment