-
Notifications
You must be signed in to change notification settings - Fork 339
Closed
Labels
Good First IssueGood for newcomersGood for newcomers[Feature] PHP.wasm[Type] BugAn existing feature does not function as intendedAn existing feature does not function as intended
Description
The mount()
method calls mkdirTree()
internally to ensure the target path exists – otherwise Emscripten throws an error. The problem is, sometimes we want to mount a file and not a directory. In these cases, the mount()
method will still create that empty dir:
wordpress-playground/packages/php-wasm/node/src/lib/node-php.ts
Lines 129 to 132 in 413d07f
mount(localPath: string | MountSettings, virtualFSPath: string) { | |
if (!this.fileExists(virtualFSPath)) { | |
this.mkdirTree(virtualFSPath); | |
} |
Let's:
- Add a check like
!this.isDir(localPath)
- Add a unit test in php-spec.ts to prevent regressions
Metadata
Metadata
Assignees
Labels
Good First IssueGood for newcomersGood for newcomers[Feature] PHP.wasm[Type] BugAn existing feature does not function as intendedAn existing feature does not function as intended