mirror of
https://github.com/atom/atom.git
synced 2026-02-15 00:55:14 -05:00
Added command line parameter to set portable
If parameter included, home directory will be copied to the portable location to make this a portable install
This commit is contained in:
@@ -4,7 +4,26 @@ temp = require "temp"
|
||||
rimraf = require "rimraf"
|
||||
AtomPortable = require "../src/browser/atom-portable"
|
||||
|
||||
describe "Portable Mode", ->
|
||||
describe "Set Portable Mode", ->
|
||||
portableAtomHomePath = path.join(path.dirname(process.execPath), "../.atom").toString()
|
||||
portableAtomHomeNaturallyExists = fs.existsSync(portableAtomHomePath)
|
||||
portableAtomHomeBackupPath = portableAtomHomePath + ".temp"
|
||||
|
||||
beforeEach ->
|
||||
fs.renameSync(portableAtomHomePath, portableAtomHomeBackupPath) if fs.existsSync(portableAtomHomePath)
|
||||
|
||||
afterEach ->
|
||||
if portableAtomHomeNaturallyExists
|
||||
fs.renameSync(portableAtomHomeBackupPath, portableAtomHomePath) if not fs.existsSync(portableAtomHomePath)
|
||||
else
|
||||
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
|
||||
|
||||
describe "Check for Portable Mode", ->
|
||||
describe "Windows", ->
|
||||
platform = "win32"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user