mirror of
https://github.com/atom/atom.git
synced 2026-01-22 21:38:10 -05:00
Add atom.getTempDirPath to return the path of "system temporary directory".
This commit is contained in:
@@ -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: ->
|
||||
|
||||
@@ -6,7 +6,7 @@ CoffeeScript = require 'coffee-script'
|
||||
CSON = require 'season'
|
||||
mkdir = require('mkdirp').sync
|
||||
|
||||
cacheDir = '/tmp/atom-compile-cache'
|
||||
cacheDir = path.join(atom.getTempDirPath(), 'atom-compile-cache')
|
||||
coffeeCacheDir = path.join(cacheDir, 'coffee')
|
||||
CSON.setCacheDir(path.join(cacheDir, 'cson'))
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@ module.exports =
|
||||
class LessCompileCache
|
||||
Subscriber.includeInto(this)
|
||||
|
||||
@cacheDir: '/tmp/atom-compile-cache/less'
|
||||
@cacheDir: path.join(atom.getTempDirPath(), 'atom-compile-cache', 'less')
|
||||
|
||||
constructor: ->
|
||||
@cache = new LessCache
|
||||
|
||||
Reference in New Issue
Block a user