Skip to content

Instantly share code, notes, and snippets.

@rubyist
Created January 18, 2009 18:50
Show Gist options
  • Save rubyist/48738 to your computer and use it in GitHub Desktop.
Save rubyist/48738 to your computer and use it in GitHub Desktop.
Index: app/src/processing/app/Preferences.java
===================================================================
--- app/src/processing/app/Preferences.java (revision 5415)
+++ app/src/processing/app/Preferences.java (working copy)
@@ -154,9 +154,13 @@
// start by loading the defaults, in case something
// important was deleted from the user prefs
try {
- load(Base.getLibStream("preferences.txt"));
+ if (commandLinePrefs != null) {
+ load(new FileInputStream(new File(commandLinePrefs)));
+ } else {
+ load(Base.getLibStream("preferences.txt"));
+ }
} catch (Exception e) {
- Base.showError(null, "Could not read default settings.\n" +
+ Base.showError(null, "Could not read default settings.\n " +
"You'll need to reinstall Processing.", e);
}
Index: app/src/processing/app/Commander.java
===================================================================
--- app/src/processing/app/Commander.java (revision 5415)
+++ app/src/processing/app/Commander.java (working copy)
@@ -136,6 +136,8 @@
complainAndQuit(platformStr + " should instead be " +
"'windows', 'macosx', or 'linux'.");
}
+ } else if (arg.startsWith(preferencesArg)) {
+ preferencesPath = arg.substring(preferencesArg.length());
} else if (arg.startsWith(sketchArg)) {
sketchFolder = arg.substring(sketchArg.length());
File sketchy = new File(sketchFolder);
@@ -294,4 +296,4 @@
out.println();
out.println("--preferences=<file> Specify a preferences file to use (optional).");
}
-}
\ No newline at end of file
+}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment