mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-06-05 21:59:27 +02:00
Skip over if folder is missing
This commit is contained in:
@@ -2726,7 +2726,12 @@ app.get('/discover_extensions', jsonParser, function (_, response) {
|
|||||||
.filter(f => fs.statSync(path.join(directories.extensions, f)).isDirectory())
|
.filter(f => fs.statSync(path.join(directories.extensions, f)).isDirectory())
|
||||||
.filter(f => f !== 'third-party');
|
.filter(f => f !== 'third-party');
|
||||||
|
|
||||||
// get all folders in the third-party folder
|
// get all folders in the third-party folder, if it exists
|
||||||
|
|
||||||
|
if (!fs.existsSync(path.join(directories.extensions, 'third-party'))) {
|
||||||
|
return response.send(extensions);
|
||||||
|
}
|
||||||
|
|
||||||
const thirdPartyExtensions = fs
|
const thirdPartyExtensions = fs
|
||||||
.readdirSync(path.join(directories.extensions, 'third-party'))
|
.readdirSync(path.join(directories.extensions, 'third-party'))
|
||||||
.filter(f => fs.statSync(path.join(directories.extensions, 'third-party', f)).isDirectory());
|
.filter(f => fs.statSync(path.join(directories.extensions, 'third-party', f)).isDirectory());
|
||||||
|
Reference in New Issue
Block a user