]> khamidou — GitHub mirrors - electron.git/commitdiff
Override default userData according to app's name
authorCheng Zhao <zcbenz@gmail.com>
Mon, 19 Jan 2015 01:58:17 +0000 (17:58 -0800)
committerCheng Zhao <zcbenz@gmail.com>
Mon, 19 Jan 2015 05:43:19 +0000 (21:43 -0800)
atom/browser/default_app/main.js
atom/browser/lib/init.coffee

index 8f6e38740312212d340d6f7a71ca3d45bfada860..c7ea581cefa692df5e127d73e76743da44482cd4 100644 (file)
@@ -41,6 +41,7 @@ if (option.file && !option.webdriver) {
         app.setName(packageJson.productName);
       else if (packageJson.name)
         app.setName(packageJson.name);
+      app.setPath('userData', path.join(app.getPath('appData'), app.getName()));
     }
 
     // Run the app.
index ae2419b2199b0d7c490d9288cde47060f3d6ba46..b0cee6badf475abb95a8a95695d631564f461e3c 100644 (file)
@@ -90,6 +90,9 @@ process.once 'BIND_DONE', ->
   else
     app.setDesktopName '#{app.getName()}.desktop'
 
+  # Set the user data path according to application's name.
+  app.setPath 'userData', path.join(app.getPath('appData'), app.getName())
+
   # Load the chrome extension support.
   require './chrome-extension.js'