You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add a hook to replace unicode quotes with normal quotes. EG:
$ cat ~/code/dho-bin/fix-shitty-quotes.sh
#!/usr/bin/env bash
# shellcheck disable=SC1111
# Purpose: Remove unicode quotes from content.
# Caveats: This is just a dump search/replace. It does not account for quoted
# content that will be misquoted after removing unicode quotes.
if [ "${#@}" -lt 1 ]; then
echo "Replaces shitty quotes with normal quotes in all given files"
echo "example: grep -rl '[“”’]' | xargs ${0##*/}"
exit 1
fi
if [ "$(uname)" == 'Darwin' ]; then
[ ! -e /usr/local/bin/gsed ] && {
echo "GNU sed is required because bsd sed is lame."
exit 1
}
/usr/local/bin/gsed -i 's/[“”]/"/g' "$@"
/usr/local/bin/gsed -i "s/’/'/g" "$@"
else
sed -i 's/[“”]/"/g' "$@"
sed -i "s/’/'/g" "$@"
fi
The text was updated successfully, but these errors were encountered:
Add a hook to replace unicode quotes with normal quotes. EG:
The text was updated successfully, but these errors were encountered: