Skip to content

Commit a6188e1

Browse files
author
Mike Pham
committed
feat(files): added file delete
1 parent b86d7b8 commit a6188e1

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

‎src/Core/Files.ts‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,16 @@ class InternalFileSystem implements FileSystem {
2828
}, this.listfiles(filepath)))
2929
}
3030

31+
public deletefile(filepath: string): Promise<void> {
32+
return new Promise<void>((resolve, reject) => fs.unlink(filepath, (error: NodeJS.ErrnoException) => {
33+
if (error) {
34+
reject(error)
35+
} else {
36+
resolve()
37+
}
38+
}))
39+
}
40+
3141
public dirname(filepath: string): string {
3242
return path.dirname(filepath)
3343
}

0 commit comments

Comments
 (0)