mirror of
https://github.com/finos/SymphonyElectron.git
synced 2025-02-25 18:55:29 -06:00
electron-205: added logic to handle directory creation failure
This commit is contained in:
parent
69df38bf77
commit
27edab4da2
@ -244,9 +244,13 @@ function doCreateMainWindow(initialUrl, initialBounds) {
|
||||
getConfigField('downloadsDirectory')
|
||||
.then((value) => {
|
||||
downloadsDirectory = value;
|
||||
// if the directory has been deleted, create it.
|
||||
// if the directory has been deleted, try creating it.
|
||||
if (!fs.existsSync(downloadsDirectory)) {
|
||||
fs.mkdirSync(downloadsDirectory);
|
||||
const directoryCreated = fs.mkdirSync(downloadsDirectory);
|
||||
// If the directory creation failed, we use the default downloads directory
|
||||
if (!directoryCreated) {
|
||||
downloadsDirectory = null;
|
||||
}
|
||||
}
|
||||
})
|
||||
.catch((error) => {
|
||||
|
Loading…
Reference in New Issue
Block a user