From 07f3ab2bd94465089535742c040c51916525efaa Mon Sep 17 00:00:00 2001 From: Alexey Kasyanchuk Date: Fri, 16 Mar 2018 14:45:40 +0300 Subject: [PATCH] fix(portable): fix error on renaming portable directory --- src/background/background.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/background/background.js b/src/background/background.js index c84fd38..a2dd758 100644 --- a/src/background/background.js +++ b/src/background/background.js @@ -211,6 +211,12 @@ console.log('Sphinx Path:', sphinxPath) const startSphinx = (callback) => { const sphinxConfigDirectory = app.getPath("userData") appConfig['dbPath'] = appConfig.dbPath && appConfig.dbPath.length > 0 ? appConfig.dbPath : sphinxConfigDirectory; + // on portable dir can move database directory + if(!fs.existsSync(appConfig.dbPath) && fs.existsSync(sphinxConfigDirectory)) + { + appConfig['dbPath'] = sphinxConfigDirectory + } + writeSphinxConfig(sphinxConfigDirectory, appConfig.dbPath) const config = `${sphinxConfigDirectory}/sphinx.conf`