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