Skip to content

Instantly share code, notes, and snippets.

@MxKaras
Last active April 14, 2021 17:31
Show Gist options
  • Save MxKaras/16650b51a111f18cb19f1afb591b9939 to your computer and use it in GitHub Desktop.
Save MxKaras/16650b51a111f18cb19f1afb591b9939 to your computer and use it in GitHub Desktop.
#!/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