Add app.setPath and app.getPath APIs

They can be used to set/get any path defined in PathService
This commit is contained in:
Cheng Zhao 2015-01-18 17:52:15 -08:00
parent 2d1afbf51b
commit 06da5f254a
4 changed files with 33 additions and 9 deletions

View file

@ -8,6 +8,12 @@ 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