vscodium/undo_telemetry.sh
swinder0161 66551077f8
Add support to use GNU sed installed in mac osx (#770)
* Add support to use GNU sed installed in mac osx

* Move common functions to utils.sh

Co-authored-by: Swinder Pal Singh Juneja <swinder.juneja@oneplus.com>
2021-07-21 22:49:00 +02:00

17 lines
558 B
Bash
Executable file

# dc.services.visualstudio.com
# vortex.data.microsoft.com
TELEMETRY_URLS="(dc\.services\.visualstudio\.com)|(vortex\.data\.microsoft\.com)"
REPLACEMENT="s/$TELEMETRY_URLS/0\.0\.0\.0/g"
#include common functions
. ../utils.sh
if [[ "$OS_NAME" == "osx" ]]; then
if is_gnu_sed; then
grep -rl --exclude-dir=.git -E $TELEMETRY_URLS . | xargs sed -i -E $REPLACEMENT
else
grep -rl --exclude-dir=.git -E $TELEMETRY_URLS . | xargs sed -i '' -E $REPLACEMENT
fi
else
grep -rl --exclude-dir=.git -E $TELEMETRY_URLS . | xargs sed -i -E $REPLACEMENT
fi