Add atom.getTempDirPath to return the path of "system temporary directory".

This commit is contained in:
Cheng Zhao
2013-10-21 21:39:52 +08:00
parent 05550717e2
commit 558778b4d4
3 changed files with 7 additions and 3 deletions

View File

@@ -13,6 +13,7 @@ remote = require 'remote'
shell = require 'shell'
crypto = require 'crypto'
path = require 'path'
os = require 'os'
dialog = remote.require 'dialog'
app = remote.require 'app'
{Document} = require 'telepath'
@@ -229,7 +230,10 @@ class Atom
@getCurrentWindow().isFullScreen()
getHomeDirPath: ->
app.getHomeDir()
process.env[if process.platform is 'win32' then 'USERPROFILE' else 'HOME']
getTempDirPath: ->
if process.platform is 'win32' then os.tmpdir() else '/tmp'
# Public: Get the directory path to Atom's configuration area.
getConfigDirPath: ->