File tree Expand file tree Collapse file tree 2 files changed +7
-3
lines changed
packages/php-wasm/node/src Expand file tree Collapse file tree 2 files changed +7
-3
lines changed Original file line number Diff line number Diff line change 1
- import type { MountHandler } from '@php-wasm/universal' ;
1
+ import type { ErrnoError , MountHandler } from '@php-wasm/universal' ;
2
2
import { statSync } from 'fs' ;
3
3
import { dirname } from 'path' ;
4
4
@@ -21,7 +21,11 @@ export function createNodeFsMountHandler(localPath: string): MountHandler {
21
21
try {
22
22
lookup = FS . lookupPath ( vfsMountPoint ) ;
23
23
} catch ( e ) {
24
- // FS.lookupPath will throw an error if the path doesn't exist.
24
+ const err = e as ErrnoError ;
25
+ // FS.lookupPath will throw an error with errno 44 if the path doesn't exist.
26
+ if ( err . errno !== 44 ) {
27
+ throw e ;
28
+ }
25
29
if ( statSync ( localPath ) . isFile ( ) ) {
26
30
FS . writeFile ( vfsMountPoint , '' ) ;
27
31
} else if ( statSync ( localPath ) . isDirectory ( ) ) {
Original file line number Diff line number Diff line change 1
1
import { createNodeFsMountHandler , loadNodeRuntime } from '..' ;
2
- import { __private__dont__use , PHP } from '@php-wasm/universal' ;
2
+ import { PHP } from '@php-wasm/universal' ;
3
3
import { RecommendedPHPVersion } from '@wp-playground/common' ;
4
4
import path from 'path' ;
5
5
import fs from 'fs' ;
You can’t perform that action at this time.
0 commit comments