Created
September 1, 2020 02:41
-
-
Save coreyja/d69858c4f0ef66aec09120c11c79901d to your computer and use it in GitHub Desktop.
Upgrade Sorbet False Files if Flipping them doesn't break anything
This file contains 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
#!/usr/bin/env bash | |
FILES_TO_TRY=$(rg '# typed: false' -l --glob "**/*.rb") | |
for FILE in $FILES_TO_TRY | |
do | |
sed -i.tmp 's/typed: false/typed: true/' "$FILE" | |
rm "$FILE.tmp" | |
srb tc || ( | |
sed -i.tmp 's/typed: true/typed: false/' "$FILE" && | |
rm "$FILE.tmp" | |
) | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment