mirror of
https://gitlab.com/soapbox-pub/shakespeare.git
synced 2026-12-05 16:23:36 +00:00
Add missing FS methods needed by isomorphic-git
This commit is contained in:
4 files changed
+26
-4
No files matched your search
@@ -77,9 +77,9 @@ class WebContainerFSAdapter implements JSRuntimeFS {
|
||||
async readdir(path: string, options?: { withFileTypes?: boolean }): Promise<string[] | DirectoryEntry[]>;
|
||||
async readdir(path: string, options?: { withFileTypes?: boolean }): Promise<string[] | DirectoryEntry[]> {
|
||||
if (options?.withFileTypes) {
|
||||
return this.webcontainer.fs.readdir(path, { withFileTypes: true }) as Promise<DirectoryEntry[]>;
|
||||
return this.webcontainer.fs.readdir(path, { withFileTypes: true });
|
||||
} else {
|
||||
return this.webcontainer.fs.readdir(path) as Promise<string[]>;
|
||||
return this.webcontainer.fs.readdir(path);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -156,4 +156,14 @@ class WebContainerFSAdapter implements JSRuntimeFS {
|
||||
// Note: We can't delete the old file since WebContainer doesn't expose unlink
|
||||
console.warn('WebContainer rename: copied file but could not delete original');
|
||||
}
|
||||
|
||||
async readlink(_path: string): Promise<string> {
|
||||
// WebContainer doesn't support symlinks, so we'll throw an error
|
||||
throw new Error('readlink operation not supported in WebContainer');
|
||||
}
|
||||
|
||||
async symlink(_target: string, _path: string): Promise<void> {
|
||||
// WebContainer doesn't support symlinks, so we'll throw an error
|
||||
throw new Error('symlink operation not supported in WebContainer');
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user