We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ae7cba1 commit f9ad3acCopy full SHA for f9ad3ac
runtime/js/fs_node.js
@@ -152,16 +152,22 @@ if (globalThis.process?.platform === "win32") {
152
: null;
153
if (
154
source_stats &&
155
- !source_stats.isDirectory() &&
+ source_stats.isDirectory() &&
156
target_stats &&
157
- target_stats.isDirectory()
+ !target_stats.isDirectory()
158
) {
159
var err = new Error("rename");
160
err.code = 26;
161
- err.path = o;
+ err.path = n;
162
this.raise_nodejs_error(err, raise_unix);
163
}
164
- if (target_stats && target_stats.isDirectory())
+ if (
165
+ source_stats &&
166
167
+ target_stats &&
168
+ target_stats.isDirectory() &&
169
+ !target.startsWith(source)
170
+ )
171
try {
172
this.fs.rmdirSync(target);
173
} catch {}
0 commit comments