mirror of
https://gitlab.com/soapbox-pub/shakespeare.git
synced 2026-12-06 08:37:22 +00:00
Implement new iframe preview system
This commit is contained in:
2 files changed
+129
-49
No files matched your search
+6
-1
@@ -199,7 +199,12 @@ export default defineConfig({
|
||||
async readFile(projectId: string, filePath: string): Promise<string> {
|
||||
const fullPath = `${this.dir}/${projectId}/${filePath}`;
|
||||
try {
|
||||
return await this.fs.promises.readFile(fullPath, 'utf8');
|
||||
const stat = await this.fs.promises.stat(fullPath);
|
||||
if (stat.isFile()) {
|
||||
return await this.fs.promises.readFile(fullPath, 'utf8');
|
||||
} else {
|
||||
throw new Error(`Path is not a file: ${filePath}`);
|
||||
}
|
||||
} catch (error) {
|
||||
const fsError = error as NodeJS.ErrnoException;
|
||||
if (fsError.code === 'ENOENT') {
|
||||
|
||||
Reference in new issue
Block a user