Skip to content

Commit 27f1ee9

Browse files
committed
Fix ReferenceError since window is a global
1 parent 2372edd commit 27f1ee9

File tree

1 file changed

+4
-8
lines changed

1 file changed

+4
-8
lines changed

src/lang/std/fileSystemManager.ts

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -182,15 +182,11 @@ export class FileSystemManager {
182182
}
183183
}
184184

185-
export const fsManager = new FileSystemManager(
186-
nodePath,
187-
window?.electron ?? testNodeFs
188-
)
185+
const fsInstance =
186+
(typeof window !== 'undefined' ? window.electron : undefined) ?? testNodeFs
187+
export const fsManager = new FileSystemManager(nodePath, fsInstance)
189188

190189
/**
191190
* The project directory is set on this.
192191
*/
193-
export const projectFsManager = new FileSystemManager(
194-
nodePath,
195-
window?.electron ?? testNodeFs
196-
)
192+
export const projectFsManager = new FileSystemManager(nodePath, fsInstance)

0 commit comments

Comments
 (0)