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