gets better

This commit is contained in:
Daniel Hübleitner
2019-08-26 22:47:36 +02:00
parent 7796061939
commit 97db1bec75
+8 -2
View File
@@ -47,7 +47,7 @@ type SharedStatus = {
outdated: boolean outdated: boolean
} }
abstract class Extension<Status>{ abstract class Extension<Status extends SharedStatus>{
constructor( constructor(
protected name: string protected name: string
){} ){}
@@ -121,9 +121,15 @@ export abstract class FSExtension extends Extension<FSStatus>{
} }
return status return status
} }
public async isEmpty(): Promise<boolean>{ public async isEmpty(): Promise<boolean>{
return true //TODO if (!this.exists) return false
else {
const files = await fs.readdir(this.prefix)
return files.length === 0
} }
}
public async exists(): Promise<boolean>{ public async exists(): Promise<boolean>{
try { try {
await fs.access(path.resolve(this.prefix, this.name)) await fs.access(path.resolve(this.prefix, this.name))