xshell 1.2.34 → 1.2.35
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/file.js +4 -2
- package/package.json +1 -1
package/file.js
CHANGED
|
@@ -294,9 +294,11 @@ export async function fdclear(fpd, { print = true, permission = false } = {}) {
|
|
|
294
294
|
if (need_permission)
|
|
295
295
|
stat = await fstat(fpd);
|
|
296
296
|
await fdelete(fpd, noprint);
|
|
297
|
-
await fmkdir(fpd,
|
|
298
|
-
if (need_permission)
|
|
297
|
+
await fmkdir(fpd, noprint);
|
|
298
|
+
if (need_permission) {
|
|
299
299
|
await fsp.chown(fpd, Number(stat.uid), Number(stat.gid));
|
|
300
|
+
await fsp.chmod(fpd, Number(stat.mode));
|
|
301
|
+
}
|
|
300
302
|
if (print)
|
|
301
303
|
console.log(`清空了文件夹 ${fpd}`);
|
|
302
304
|
return fpd;
|