Clean convention inconsistencies for portable mode

This commit is contained in:
Dave Rael
2015-10-15 14:32:33 -06:00
parent 16c2391b14
commit 265ee01c1d
2 changed files with 4 additions and 3 deletions

View File

@@ -5,9 +5,9 @@ rimraf = require "rimraf"
AtomPortable = require "../src/browser/atom-portable"
describe "Set Portable Mode", ->
portableAtomHomePath = path.join(path.dirname(process.execPath), "../.atom").toString()
portableAtomHomePath = path.join(path.dirname(process.execPath), '..', '.atom')
portableAtomHomeNaturallyExists = fs.existsSync(portableAtomHomePath)
portableAtomHomeBackupPath = portableAtomHomePath + ".temp"
portableAtomHomeBackupPath = "#{portableAtomHomePath}.temp"
beforeEach ->
fs.renameSync(portableAtomHomePath, portableAtomHomeBackupPath) if fs.existsSync(portableAtomHomePath)
@@ -19,6 +19,7 @@ describe "Set Portable Mode", ->
rimraf.sync(portableAtomHomePath) if fs.existsSync(portableAtomHomePath)
rimraf.sync(portableAtomHomeBackupPath) if fs.existsSync(portableAtomHomeBackupPath)
it "creates portable home directory", ->
AtomPortable.setPortable(process.env.ATOM_HOME)
expect(fs.existsSync(portableAtomHomePath)).toBe true

View File

@@ -6,7 +6,7 @@ module.exports =
class AtomPortable
@portableAtomHomePath: ->
execDirectoryPath = path.dirname(process.execPath)
return path.join(execDirectoryPath, "../.atom/")
return path.join(execDirectoryPath, '..', '.atom')
@setPortable: (existingAtomHome) ->
fs.copySync(existingAtomHome, @portableAtomHomePath())