31e07756612ffa47e87a568aaf67142622912a55844010d3d3d73ccec0b76ccee2bb28ef4d678cf97de04c48842f5e771eebfae3c68a9da0219c4a013a161d 753 B

12345678910111213141516171819202122232425
  1. export const modeFix = (mode, isDir, portable) => {
  2. mode &= 0o7777;
  3. // in portable mode, use the minimum reasonable umask
  4. // if this system creates files with 0o664 by default
  5. // (as some linux distros do), then we'll write the
  6. // archive with 0o644 instead. Also, don't ever create
  7. // a file that is not readable/writable by the owner.
  8. if (portable) {
  9. mode = (mode | 0o600) & ~0o22;
  10. }
  11. // if dirs are readable, then they should be listable
  12. if (isDir) {
  13. if (mode & 0o400) {
  14. mode |= 0o100;
  15. }
  16. if (mode & 0o40) {
  17. mode |= 0o10;
  18. }
  19. if (mode & 0o4) {
  20. mode |= 0o1;
  21. }
  22. }
  23. return mode;
  24. };
  25. //# sourceMappingURL=mode-fix.js.map