From be09e7829f0db8cc4e32b84a26496826eb9ee5a2 Mon Sep 17 00:00:00 2001 From: Eugene Date: Thu, 23 Jan 2020 14:01:56 +0100 Subject: [PATCH] fixed #2048 --- app/lib/index.ts | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/app/lib/index.ts b/app/lib/index.ts index 0fdd4dc1..58992ac3 100644 --- a/app/lib/index.ts +++ b/app/lib/index.ts @@ -13,15 +13,12 @@ if (!process.env.TERMINUS_PLUGINS) { const application = new Application() -const portableData = path.join(`${process.env.PORTABLE_EXECUTABLE_DIR}`, 'data') -if (('PORTABLE_EXECUTABLE_DIR' in process.env) && fs.existsSync(portableData)) { - fs.stat(portableData, (err, stats) => { - if (stats.isDirectory()) { - app.setPath('userData' ,portableData) - } else { - console.warn(err) - } - }) +if (process.env.PORTABLE_EXECUTABLE_DIR) { + const portableData = path.join(process.env.PORTABLE_EXECUTABLE_DIR, 'terminus-data') + if (!fs.existsSync(portableData)) { + fs.mkdirSync(portableData) + } + app.setPath('userData', portableData) } ipcMain.on('app:new-window', () => {