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.
Files changed (2) hide show
  1. package/file.js +4 -2
  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, need_permission ? { print: false, mode: Number(stat.mode) } : noprint);
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;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "xshell",
3
- "version": "1.2.34",
3
+ "version": "1.2.35",
4
4
  "type": "module",
5
5
  "main": "./index.js",
6
6
  "bin": {