Add app.setPath and app.getPath APIs
They can be used to set/get any path defined in PathService
This commit is contained in:
parent
2d1afbf51b
commit
06da5f254a
4 changed files with 33 additions and 9 deletions
|
@ -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
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue