mirror of
https://github.com/reecetech/version-increment.git
synced 2025-12-21 14:35:44 +00:00
Force utf8 for all commands during execution
This commit is contained in:
@@ -2,6 +2,9 @@
|
|||||||
# shellcheck disable=SC2034
|
# shellcheck disable=SC2034
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
|
|
||||||
|
# Force UTF-8 for all commands, for Git-Bash on Windows compatibility
|
||||||
|
export LC_ALL=C.UTF-8
|
||||||
|
|
||||||
##==----------------------------------------------------------------------------
|
##==----------------------------------------------------------------------------
|
||||||
## SemVer regexes
|
## SemVer regexes
|
||||||
## see: https://semver.org/spec/v2.0.0.html#is-there-a-suggested-regular-expression-regex-to-check-a-semver-string
|
## see: https://semver.org/spec/v2.0.0.html#is-there-a-suggested-regular-expression-regex-to-check-a-semver-string
|
||||||
@@ -68,13 +71,13 @@ fi
|
|||||||
|
|
||||||
function grep_p() {
|
function grep_p() {
|
||||||
if [[ "${use_perl}" == 'true' ]] ; then
|
if [[ "${use_perl}" == 'true' ]] ; then
|
||||||
LC_ALL=C.UTF-8 perl -ne "print if /${1}/"
|
perl -ne "print if /${1}/"
|
||||||
elif [[ "${use_gnugrep}" == 'true' ]] ; then
|
elif [[ "${use_gnugrep}" == 'true' ]] ; then
|
||||||
# shellcheck disable=SC2086
|
# shellcheck disable=SC2086
|
||||||
LC_ALL=C.UTF-8 ggrep -P "${1}"
|
ggrep -P "${1}"
|
||||||
else
|
else
|
||||||
# shellcheck disable=SC2086
|
# shellcheck disable=SC2086
|
||||||
LC_ALL=C.UTF-8 command grep -P "${1}"
|
command grep -P "${1}"
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user