diff --git a/atom/browser/api/atom_api_app.cc b/atom/browser/api/atom_api_app.cc index d5c688352980..884c3d90a0ce 100644 --- a/atom/browser/api/atom_api_app.cc +++ b/atom/browser/api/atom_api_app.cc @@ -67,6 +67,8 @@ int GetPathConstant(const std::string& name) { return brightray::DIR_APP_DATA; else if (name == "userData") return brightray::DIR_USER_DATA; + else if (name == "home") + return base::DIR_HOME; else return -1; } diff --git a/atom/browser/api/lib/app.coffee b/atom/browser/api/lib/app.coffee index 5ac0d719f4c9..aad56fd91238 100644 --- a/atom/browser/api/lib/app.coffee +++ b/atom/browser/api/lib/app.coffee @@ -5,15 +5,6 @@ bindings = process.atomBinding 'app' app = bindings.app app.__proto__ = EventEmitter.prototype -app.getHomeDir = -> - process.env[if process.platform is 'win32' then 'USERPROFILE' else 'HOME'] - -app.getDataPath = -> - app.getPath 'userData' - -app.setDataPath = (path) -> - app.setPath 'userData', path - app.setApplicationMenu = (menu) -> require('menu').setApplicationMenu menu @@ -38,6 +29,9 @@ if process.platform is 'darwin' app.once 'ready', -> app.emit 'finish-launching' app.terminate = app.quit app.exit = process.exit +app.getHomeDir = -> app.getPath 'home' +app.getDataPath = -> app.getPath 'userData' +app.setDataPath = (path) -> app.setPath 'userData', path # Only one App object pemitted. module.exports = app