Ensuring the radio presets dir exists
This commit is contained in:
@@ -2,7 +2,7 @@ import fs from 'fs';
|
||||
import path from 'path';
|
||||
import express from 'express';
|
||||
import { fileURLToPath } from 'url';
|
||||
import { generateUniqueID } from '../../modules/baseUtils.mjs';
|
||||
import { generateUniqueID, ensureDirectoryExists } from '../../modules/baseUtils.mjs';
|
||||
import { restartApplication } from '../../modules/selfUpdater.mjs'
|
||||
import { launchProcess } from '../../modules/subprocessHandler.mjs'
|
||||
|
||||
@@ -145,6 +145,10 @@ const exportSystems = (systemsData) => {
|
||||
whitelistFile: system.whitelistFile || ''
|
||||
}
|
||||
));
|
||||
|
||||
// Ensure directory exists
|
||||
ensureDirectoryExists(radioPresetsPath);
|
||||
|
||||
return new Promise(res => {
|
||||
fs.access(radioPresetsPath, fs.constants.F_OK, (err) => {
|
||||
if (err) {
|
||||
@@ -171,5 +175,5 @@ const exportSystems = (systemsData) => {
|
||||
});
|
||||
}
|
||||
});
|
||||
})
|
||||
});
|
||||
}
|
||||
Reference in New Issue
Block a user