diff --git a/src/atom.coffee b/src/atom.coffee index 0b6d3896f..8aadbbe5b 100644 --- a/src/atom.coffee +++ b/src/atom.coffee @@ -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: -> diff --git a/src/coffee-cache.coffee b/src/coffee-cache.coffee index 25c6a7472..ecf66dc9e 100644 --- a/src/coffee-cache.coffee +++ b/src/coffee-cache.coffee @@ -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')) diff --git a/src/less-compile-cache.coffee b/src/less-compile-cache.coffee index 8dfafa27e..98c7d45fa 100644 --- a/src/less-compile-cache.coffee +++ b/src/less-compile-cache.coffee @@ -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