浏览代码

re-disable telemetry; closes #872 (#883)

Pavlo Rudy 3 年之前
父节点
当前提交
b0ff3b4f34
共有 1 个文件被更改,包括 11 次插入3 次删除
  1. 11 3
      update_settings.sh

+ 11 - 3
update_settings.sh

@@ -1,7 +1,10 @@
 DEFAULT_TRUE="'default': true"
 DEFAULT_FALSE="'default': false"
+DEFAULT_ON="'default': TelemetryConfiguration.ON"
+DEFAULT_OFF="'default': TelemetryConfiguration.OFF"
 TELEMETRY_ENABLE="'telemetry.enableTelemetry':"
 TELEMETRY_CRASH_REPORTER="'telemetry.enableCrashReporter':"
+TELEMETRY_CONFIGURATION=" TelemetryConfiguration.ON"
 
 #include common functions
 . ../utils.sh
@@ -22,7 +25,7 @@ update_setting () {
     if [[ $line == *"$SETTING"* ]]; then
       local IN_SETTING=1
     fi
-    if [[ $line == *"$DEFAULT_TRUE"* && "$IN_SETTING" == "1" ]]; then
+    if [[ ($line == *"$DEFAULT_TRUE"* || $line == *"$DEFAULT_ON"*) && "$IN_SETTING" == "1" ]]; then
       local FOUND=1
       break
     fi
@@ -34,10 +37,15 @@ update_setting () {
   fi
 
   # construct line-aware replacement string
-  local DEFAULT_TRUE_TO_FALSE="${LINE_NUM}s/${DEFAULT_TRUE}/${DEFAULT_FALSE}/"
-
+  if [[ $line == *"$DEFAULT_TRUE"* ]]; then
+    local DEFAULT_TRUE_TO_FALSE="${LINE_NUM}s/${DEFAULT_TRUE}/${DEFAULT_FALSE}/"
+  else 
+    local DEFAULT_TRUE_TO_FALSE="${LINE_NUM}s/${DEFAULT_ON}/${DEFAULT_OFF}/"
+  fi
+  
   replace "$DEFAULT_TRUE_TO_FALSE" $FILENAME
 }
 
 update_setting "$TELEMETRY_ENABLE" src/vs/platform/telemetry/common/telemetryService.ts
 update_setting "$TELEMETRY_CRASH_REPORTER" src/vs/workbench/electron-sandbox/desktop.contribution.ts
+update_setting "$TELEMETRY_CONFIGURATION" src/vs/platform/telemetry/common/telemetryService.ts