Last active
May 20, 2023 17:03
-
-
Save atierian/9f11f55ebc5eb7c2dec912a41217337e to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Invoke from root project directory after running `amplify codegen models` to add `CaseIterable` | |
# conformance to all codegen'd enums | |
FILES="amplify/generated/models/*.swift" | |
for f in $FILES | |
do | |
echo "Processing $f file..." | |
awk '/public enum [^CodingKeys]/ {gsub($0, "extension " $3 " CaseIterable {}"); print "\n" $0}' $f >> $f | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment