Ignore errors in getContentOfType
This commit is contained in:
parent
5001187b3c
commit
d7a37298ab
|
@ -232,18 +232,22 @@ function getContentOfType(type, format) {
|
||||||
if (!item.folder) {
|
if (!item.folder) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
const filePath = path.join(item.folder, item.filename);
|
try {
|
||||||
const fileContent = fs.readFileSync(filePath);
|
const filePath = path.join(item.folder, item.filename);
|
||||||
switch (format) {
|
const fileContent = fs.readFileSync(filePath);
|
||||||
case 'json':
|
switch (format) {
|
||||||
files.push(JSON.parse(fileContent.toString()));
|
case 'json':
|
||||||
break;
|
files.push(JSON.parse(fileContent.toString()));
|
||||||
case 'string':
|
break;
|
||||||
files.push(fileContent.toString());
|
case 'string':
|
||||||
break;
|
files.push(fileContent.toString());
|
||||||
case 'raw':
|
break;
|
||||||
files.push(fileContent);
|
case 'raw':
|
||||||
break;
|
files.push(fileContent);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
} catch {
|
||||||
|
// Ignore errors
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return files;
|
return files;
|
||||||
|
|
Loading…
Reference in New Issue