Last active
April 14, 2021 17:31
-
-
Save MxKaras/16650b51a111f18cb19f1afb591b9939 to your computer and use it in GitHub Desktop.
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 zsh | |
# I forget why but it didn't work in bash | |
# requires: ripgrep; sponge | |
function do-replace() { | |
pattern=$1 | |
replacement=$2 | |
for f in `rg -l $pattern --type kotlin`; do | |
rg --passthru $pattern -r $replacement $f | sponge $f | |
done | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment