You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Using rmdir(path, { recursive: true }) is not an option because recursive: true is deprecated and (correctly) not exposed by NodeishFilesystem. Node recommends using rm(path, { recursive: true, force: true }) instead:
Proposal
NodeishFilesystem.rm needs the force option.
The text was updated successfully, but these errors were encountered:
PS man what an ugly API with way too many gotchas. But, let's get NodeishFilesystem in check first. Then, in a year or so introduce a sane Filesystem API.
As long as the directory is guaranteed to exist, you should be able to call await fs.rm(rootTempDir, { recursive: true }) to accomplish the desired behavior. If there is a possibility the directory does not exist you should be able to do something like await fs.rm(...).catch( e => e.code !== 'ENOENT' && throw e) to replicate the behavior of the force option.
@araknast Yep, await fs.rm(rootTempDir, { recursive: true }) works! Again, what an ugly API. Eventually, we should have the force option. But, closing this issue until then.
Problem
The tests in #743 are failing because
rmdir
is used on a directory that contains files:https://github.com/inlang/inlang/blob/6b8f7c65309b8c9645e68a27c85cda1b94fdc70c/source-code-git/fs/src/utilities/fromJson.test.ts#L10-L13
Using
rmdir(path, { recursive: true })
is not an option becauserecursive: true
is deprecated and (correctly) not exposed byNodeishFilesystem
. Node recommends usingrm(path, { recursive: true, force: true })
instead:Proposal
NodeishFilesystem.rm
needs the force option.The text was updated successfully, but these errors were encountered: