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 @@ -91,16 +91,25 @@ def relink_initialworkdir(
9191 # directory, so therefore ineligable for being an output file.
9292 # Thus, none of our business
9393 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+ )
95103 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 )
97105 os .remove (host_outdir_tgt )
98106 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 )
100108 shutil .rmtree (host_outdir_tgt )
101109 if not vol .resolved .startswith ("_:" ):
102110 os .symlink (vol .resolved , host_outdir_tgt )
103111
112+
104113def neverquote (string : str , pos : int = 0 , endpos : int = 0 ) -> Optional [Match [str ]]:
105114 return None
106115
You can’t perform that action at this time.
0 commit comments