Created
April 13, 2022 12:28
-
-
Save hovsater/18e41e112a8f87623745239386776ac6 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 bash | |
set -e | |
if [[ $# -lt 2 ]]; then | |
>&2 echo "usage: dte-replace <search> <replacement> [rg_args]" | |
exit 1 | |
fi | |
rg "$1" --files-with-matches ${@:3} | xargs -n1 dte -c 'replace -c '$1' '$2'; save; quit' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment