Skip to content
Permalink
Browse files
Initialize preferences before Telemetry nag
Initialize preferences before relying on them in telemetry nag code in several cmdline tools.
Fixes #1255.
  • Loading branch information
Pieter12345 committed Jan 29, 2021
1 parent 60f1a26 commit 5e04ddf
Showing 1 changed file with 4 additions and 0 deletions.
@@ -422,6 +422,7 @@ public ArgumentParser getArgumentParser() {

@Override
public void execute(ArgumentParser.ArgumentParserResults parsedArgs) throws Exception {
Prefs.init(MethodScriptFileLocations.getDefault().getPreferencesFile());
Telemetry.GetDefault().doNag();
String commandName = parsedArgs.getStringArgument("command");
Interpreter.install(commandName);
@@ -459,6 +460,7 @@ public ArgumentParser getArgumentParser() {
public void execute(ArgumentParser.ArgumentParserResults parsedArgs) throws Exception {
// TODO: This should eventually be changed to use an independent
// versioning scheme for CH and MS.
Prefs.init(MethodScriptFileLocations.getDefault().getPreferencesFile());
Telemetry.GetDefault().doNag();
StreamUtils.GetSystemOut().println("You are running "
+ Implementation.GetServerType().getBranding() + " version " + Static.loadSelfVersion());
@@ -537,6 +539,7 @@ public ArgumentParser getArgumentParser() {
@Override
@SuppressWarnings("ResultOfObjectAllocationIgnored")
public void execute(ArgumentParser.ArgumentParserResults parsedArgs) throws Exception {
Prefs.init(MethodScriptFileLocations.getDefault().getPreferencesFile());
Telemetry.GetDefault().doNag();
new Interpreter(parsedArgs.getStringListArgument(), parsedArgs.getStringArgument("location-----"));
}
@@ -1668,6 +1671,7 @@ public ArgumentParser getArgumentParser() {

@Override
public void execute(ArgumentParser.ArgumentParserResults parsedArgs) throws Exception {
Prefs.init(MethodScriptFileLocations.getDefault().getPreferencesFile());
Telemetry.GetDefault().doNag();
Map<String, String> topics = new HashMap<>();
for(ExtensionTracker t : ExtensionManager.getTrackers().values()) {

0 comments on commit 5e04ddf

Please sign in to comment.