mirror of
https://github.com/atom/atom.git
synced 2026-01-24 14:28:14 -05:00
Clean convention inconsistencies for portable mode
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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())
|
||||
|
||||
Reference in New Issue
Block a user