Delete extensions file when there are no loaded extensions
This commit is contained in:
parent
5714ae0b73
commit
6252511b7f
1 changed files with 9 additions and 5 deletions
|
@ -54,12 +54,16 @@ app.on('will-quit', function() {
|
||||||
loadedExtensions = Object.keys(extensionInfoMap).map(function(key) {
|
loadedExtensions = Object.keys(extensionInfoMap).map(function(key) {
|
||||||
return extensionInfoMap[key].srcDirectory;
|
return extensionInfoMap[key].srcDirectory;
|
||||||
});
|
});
|
||||||
try {
|
if (loadedExtensions.length > 0) {
|
||||||
fs.mkdirSync(path.dirname(loadedExtensionsPath));
|
try {
|
||||||
} catch (error) {
|
fs.mkdirSync(path.dirname(loadedExtensionsPath));
|
||||||
// Ignore error
|
} catch (error) {
|
||||||
|
// Ignore error
|
||||||
|
}
|
||||||
|
return fs.writeFileSync(loadedExtensionsPath, JSON.stringify(loadedExtensions));
|
||||||
|
} else {
|
||||||
|
fs.unlinkSync(loadedExtensionsPath);
|
||||||
}
|
}
|
||||||
return fs.writeFileSync(loadedExtensionsPath, JSON.stringify(loadedExtensions));
|
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
// Ignore error
|
// Ignore error
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue