File tree Expand file tree Collapse file tree 1 file changed +19
-0
lines changed
Expand file tree Collapse file tree 1 file changed +19
-0
lines changed Original file line number Diff line number Diff line change @@ -9,8 +9,10 @@ const fsPromises = require('fs/promises');
99const {
1010 access,
1111 chmod,
12+ chown,
1213 copyFile,
1314 fchmod,
15+ fchown,
1416 fdatasync,
1517 fstat,
1618 fsync,
@@ -27,6 +29,8 @@ const {
2729 realpath,
2830 rename,
2931 rmdir,
32+ lchmod,
33+ lchown,
3034 stat,
3135 symlink,
3236 write,
@@ -95,6 +99,21 @@ function verifyStatObject(stat) {
9599
96100 await chmod ( dest , 0o666 ) ;
97101 await fchmod ( handle , 0o666 ) ;
102+ // lchmod is only available on OSX
103+ if ( common . isOSX ) {
104+ await lchmod ( dest , 0o666 ) ;
105+ }
106+
107+ if ( ! common . isWindows ) {
108+ const gid = process . getgid ( ) ;
109+ const uid = process . getuid ( ) ;
110+ await chown ( dest , uid , gid ) ;
111+ await fchown ( handle , uid , gid ) ;
112+ // lchown is only available on OSX
113+ if ( common . isOSX ) {
114+ await lchown ( dest , uid , gid ) ;
115+ }
116+ }
98117
99118 await utimes ( dest , new Date ( ) , new Date ( ) ) ;
100119
You can’t perform that action at this time.
0 commit comments