mirror of
https://github.com/pulsar-edit/pulsar.git
synced 2024-09-19 15:08:08 +03:00
Create and restore ATOM_HOME for the socket stuff
This commit is contained in:
parent
ad2b431c5c
commit
1ba571becd
@ -669,10 +669,12 @@ class LaunchScenario {
|
||||
this.applications = new Set()
|
||||
this.windows = new Set()
|
||||
this.root = null
|
||||
this.atomHome = null
|
||||
this.projectRootPool = new Map()
|
||||
this.filePathPool = new Map()
|
||||
|
||||
this.killedPids = []
|
||||
this.originalAtomHome = null
|
||||
}
|
||||
|
||||
async init () {
|
||||
@ -686,6 +688,15 @@ class LaunchScenario {
|
||||
})
|
||||
})
|
||||
|
||||
this.atomHome = path.join(this.root, '.atom')
|
||||
await new Promise((resolve, reject) => {
|
||||
fs.makeTree(this.atomHome, err => {
|
||||
if (err) { reject(err) } else { resolve() }
|
||||
})
|
||||
})
|
||||
this.originalAtomHome = process.env.ATOM_HOME
|
||||
process.env.ATOM_HOME = this.atomHome
|
||||
|
||||
await Promise.all(
|
||||
['a', 'b', 'c'].map(dirPath => new Promise((resolve, reject) => {
|
||||
const fullDirPath = path.join(this.root, dirPath)
|
||||
@ -884,6 +895,10 @@ class LaunchScenario {
|
||||
await Promise.all(
|
||||
Array.from(this.applications, app => app.destroy())
|
||||
)
|
||||
|
||||
if (this.originalAtomHome) {
|
||||
process.env.ATOM_HOME = this.originalAtomHome
|
||||
}
|
||||
}
|
||||
|
||||
addApplication (options = {}) {
|
||||
|
Loading…
Reference in New Issue
Block a user