File tree Expand file tree Collapse file tree 1 file changed +12
-3
lines changed Expand file tree Collapse file tree 1 file changed +12
-3
lines changed Original file line number Diff line number Diff line change @@ -98,16 +98,25 @@ def relink_initialworkdir(
98
98
# directory, so therefore ineligable for being an output file.
99
99
# Thus, none of our business
100
100
continue
101
- host_outdir_tgt = os .path .join (host_outdir , vol .target [len (container_outdir ) + 1 :])
101
+ host_outdir_tgt = os .path .join (
102
+ host_outdir , vol .target [len (container_outdir ) + 1 :]
103
+ )
104
+ mode = (
105
+ os .stat (host_outdir_tgt ).st_mode
106
+ | stat .S_IWUSR
107
+ | stat .S_IWGRP
108
+ | stat .S_IWOTH
109
+ )
102
110
if os .path .islink (host_outdir_tgt ) or os .path .isfile (host_outdir_tgt ):
103
- subprocess . run ([ " chmod" , "777" , host_outdir_tgt ], check = True )
111
+ os . chmod ( host_outdir_tgt , mode )
104
112
os .remove (host_outdir_tgt )
105
113
elif os .path .isdir (host_outdir_tgt ) and not vol .resolved .startswith ("_:" ):
106
- subprocess . run ([ " chmod" , "777" , host_outdir_tgt ], check = True )
114
+ os . chmod ( host_outdir_tgt , mode )
107
115
shutil .rmtree (host_outdir_tgt )
108
116
if not vol .resolved .startswith ("_:" ):
109
117
os .symlink (vol .resolved , host_outdir_tgt )
110
118
119
+
111
120
def neverquote (string : str , pos : int = 0 , endpos : int = 0 ) -> Optional [Match [str ]]:
112
121
return None
113
122
You can’t perform that action at this time.
0 commit comments