Do not use "/tmp" in scripts.

This commit is contained in:
Cheng Zhao 2013-10-21 21:42:55 +08:00
parent 558778b4d4
commit 459309aa78
4 changed files with 15 additions and 4 deletions

View File

@ -1,5 +1,6 @@
fs = require 'fs'
path = require 'path'
os = require 'os'
fm = require 'json-front-matter'
_ = require 'underscore-plus'
@ -9,7 +10,8 @@ packageJson = require './package.json'
module.exports = (grunt) ->
appName = 'Atom.app'
[major, minor, patch] = packageJson.version.split('.')
buildDir = grunt.option('build-dir') ? '/tmp/atom-build'
tmpDir = if process.platform is 'win32' then os.tmpdir() else '/tmp'
buildDir = grunt.option('build-dir') ? path.join(tmpDir, 'atom-build')
shellAppDir = path.join(buildDir, appName)
contentsDir = path.join(shellAppDir, 'Contents')
appDir = path.join(contentsDir, 'Resources', 'app')

View File

@ -8,13 +8,14 @@ dialog = require 'dialog'
fs = require 'fs'
ipc = require 'ipc'
path = require 'path'
os = require 'os'
net = require 'net'
shell = require 'shell'
url = require 'url'
{EventEmitter} = require 'events'
_ = require 'underscore-plus'
socketPath = '/tmp/atom.sock'
socketPath = path.join(os.tmpdir(), 'atom.sock')
# Private: The application's singleton class.
#

View File

@ -1,13 +1,16 @@
path = require 'path'
os = require 'os'
module.exports = (grunt) ->
{rm} = require('./task-helpers')(grunt)
grunt.registerTask 'partial-clean', 'Delete some of the build files', ->
tmpdir = if process.platform is 'win32' then os.tmpdir() else '/tmp'
rm grunt.config.get('atom.buildDir')
rm require('../src/coffee-cache').cacheDir
rm require('../src/less-compile-cache').cacheDir
rm '/tmp/atom-cached-atom-shells'
rm path.join(tmpdir, 'atom-cached-atom-shells')
rm 'atom-shell'
grunt.registerTask 'clean', 'Delete all the build files', ->

View File

@ -1,5 +1,6 @@
fs = require 'fs'
path = require 'path'
os = require 'os'
request = require 'request'
formidable = require 'formidable'
@ -70,7 +71,11 @@ module.exports = (grunt) ->
else
null
getCachePath = (version) -> "/tmp/atom-cached-atom-shells/#{version}"
getTempDir = ->
if process.platform is 'win32' then os.tmpdir() else '/tmp'
getCachePath = (version) ->
path.join(getTempDir(), 'atom-cached-atom-shells', version)
isAtomShellVersionCached = (version) ->
grunt.file.isFile(getCachePath(version), 'version')