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');
9
9
const {
10
10
access,
11
11
chmod,
12
+ chown,
12
13
copyFile,
13
14
fchmod,
15
+ fchown,
14
16
fdatasync,
15
17
fstat,
16
18
fsync,
@@ -27,6 +29,8 @@ const {
27
29
realpath,
28
30
rename,
29
31
rmdir,
32
+ lchmod,
33
+ lchown,
30
34
stat,
31
35
symlink,
32
36
write,
@@ -95,6 +99,21 @@ function verifyStatObject(stat) {
95
99
96
100
await chmod ( dest , 0o666 ) ;
97
101
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
+ }
98
117
99
118
await utimes ( dest , new Date ( ) , new Date ( ) ) ;
100
119
You can’t perform that action at this time.
0 commit comments