send or print newsletter preview
This commit is contained in:
parent
5a59a63e4a
commit
5f827fb177
15 changed files with 355 additions and 28 deletions
|
@ -24,6 +24,9 @@ export abstract class FileSystemHelper {
|
|||
|
||||
static getFilesInDirectory(directoryPath: string, filetype?: string): string[] {
|
||||
const fullPath = join(process.cwd(), directoryPath);
|
||||
if (!existsSync(fullPath)) {
|
||||
return [];
|
||||
}
|
||||
return readdirSync(fullPath, { withFileTypes: true })
|
||||
.filter((dirent) => !dirent.isDirectory() && (!filetype || dirent.name.endsWith(filetype)))
|
||||
.map((dirent) => dirent.name);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue