mirror of
https://gitlab.com/MrFry/mrfrys-node-server
synced 2025-04-01 20:24:18 +02:00
Apis for listing user files, log rotate fix
This commit is contained in:
parent
c64c189ce3
commit
406caabefd
3 changed files with 69 additions and 11 deletions
|
@ -70,8 +70,14 @@ function CopyFile(from: string, to: string): void {
|
|||
fs.copyFileSync(from, to)
|
||||
}
|
||||
|
||||
function ReadDir(path: string): Array<string> {
|
||||
return fs.readdirSync(path)
|
||||
function ReadDir(path: string, listHidden?: boolean): Array<string> {
|
||||
if (listHidden) {
|
||||
return fs.readdirSync(path)
|
||||
} else {
|
||||
return fs.readdirSync(path).filter((file) => {
|
||||
return !file.startsWith('.')
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
function ReadJSON(name: string): any {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue