Skip to content

Commit 83229ec

Browse files
committed
fix(serve): Support dynamically set userData path
1 parent f35c64c commit 83229ec

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

lib/installVueDevtools/index.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@ import { getPath } from './utils'
88
const { BrowserWindow } = remote || electron
99

1010
let IDMap = {}
11-
const IDMapPath = path.resolve(getPath(), 'IDMap.json')
12-
if (fs.existsSync(IDMapPath)) {
11+
const getIDMapPath = () => path.resolve(getPath(), 'IDMap.json')
12+
if (fs.existsSync(getIDMapPath())) {
1313
try {
14-
IDMap = JSON.parse(fs.readFileSync(IDMapPath, 'utf8'))
14+
IDMap = JSON.parse(fs.readFileSync(getIDMapPath(), 'utf8'))
1515
} catch (err) {
1616
console.error(
1717
'electron-devtools-installer: Invalid JSON present in the IDMap file'
@@ -38,7 +38,7 @@ const install = (forceDownload = false) => {
3838
}
3939
const name = BrowserWindow.addDevToolsExtension(extensionFolder) // eslint-disable-line
4040
fs.writeFileSync(
41-
IDMapPath,
41+
getIDMapPath(),
4242
JSON.stringify(
4343
Object.assign(IDMap, {
4444
[chromeStoreID]: name

0 commit comments

Comments
 (0)