Merge pull request #735 from daiyam/fix-sed

detect sed version
This commit is contained in:
Peter Squicciarini 2021-06-07 02:12:33 -07:00 committed by GitHub
commit 15fac881ce
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -3,12 +3,16 @@ DEFAULT_FALSE="'default': false"
TELEMETRY_ENABLE="'telemetry.enableTelemetry':"
TELEMETRY_CRASH_REPORTER="'telemetry.enableCrashReporter':"
is_gnu_sed () {
sed --version >/dev/null 2>&1
}
replace () {
echo $1
if [[ "$OS_NAME" == "osx" ]]; then
sed -i '' -E "$1" $2
else
if is_gnu_sed; then
sed -i -E "$1" $2
else
sed -i '' -E "$1" $2
fi
}