diff --git a/src/coffee-cache.coffee b/src/coffee-cache.coffee index ecf66dc9e..263cd924c 100644 --- a/src/coffee-cache.coffee +++ b/src/coffee-cache.coffee @@ -1,12 +1,14 @@ crypto = require 'crypto' fs = require 'fs' path = require 'path' +os = require 'os' CoffeeScript = require 'coffee-script' CSON = require 'season' mkdir = require('mkdirp').sync -cacheDir = path.join(atom.getTempDirPath(), 'atom-compile-cache') +tmpDir = if process.platform is 'win32' then os.tmpdir() else '/tmp' +cacheDir = path.join(tmpDir, '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 98c7d45fa..977ede9ff 100644 --- a/src/less-compile-cache.coffee +++ b/src/less-compile-cache.coffee @@ -1,12 +1,15 @@ path = require 'path' +os = require 'os' LessCache = require 'less-cache' {Subscriber} = require 'emissary' +tmpDir = if process.platform is 'win32' then os.tmpdir() else '/tmp' + module.exports = class LessCompileCache Subscriber.includeInto(this) - @cacheDir: path.join(atom.getTempDirPath(), 'atom-compile-cache', 'less') + @cacheDir: path.join(tmpDir, 'atom-compile-cache', 'less') constructor: -> @cache = new LessCache