gets better
This commit is contained in:
@@ -47,7 +47,7 @@ type SharedStatus = {
|
||||
outdated: boolean
|
||||
}
|
||||
|
||||
abstract class Extension<Status>{
|
||||
abstract class Extension<Status extends SharedStatus>{
|
||||
constructor(
|
||||
protected name: string
|
||||
){}
|
||||
@@ -121,9 +121,15 @@ export abstract class FSExtension extends Extension<FSStatus>{
|
||||
}
|
||||
return status
|
||||
}
|
||||
|
||||
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>{
|
||||
try {
|
||||
await fs.access(path.resolve(this.prefix, this.name))
|
||||
|
||||
Reference in New Issue
Block a user