This commit is contained in:
Eugene 2020-01-23 14:01:56 +01:00 committed by GitHub
parent 8f361f841c
commit be09e7829f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -13,15 +13,12 @@ if (!process.env.TERMINUS_PLUGINS) {
const application = new Application() const application = new Application()
const portableData = path.join(`${process.env.PORTABLE_EXECUTABLE_DIR}`, 'data') if (process.env.PORTABLE_EXECUTABLE_DIR) {
if (('PORTABLE_EXECUTABLE_DIR' in process.env) && fs.existsSync(portableData)) { const portableData = path.join(process.env.PORTABLE_EXECUTABLE_DIR, 'terminus-data')
fs.stat(portableData, (err, stats) => { if (!fs.existsSync(portableData)) {
if (stats.isDirectory()) { fs.mkdirSync(portableData)
app.setPath('userData' ,portableData)
} else {
console.warn(err)
} }
}) app.setPath('userData', portableData)
} }
ipcMain.on('app:new-window', () => { ipcMain.on('app:new-window', () => {