File tree Expand file tree Collapse file tree 2 files changed +7
-10
lines changed Expand file tree Collapse file tree 2 files changed +7
-10
lines changed Original file line number Diff line number Diff line change @@ -236,7 +236,9 @@ def add_file_or_directory_volume(
236
236
"""Append volume a file/dir mapping to the runtime option list."""
237
237
if not volume .resolved .startswith ("_:" ):
238
238
_check_docker_machine_path (volume .resolved )
239
- self .append_volume (runtime , volume .resolved , volume .target )
239
+ self .append_volume (
240
+ runtime , volume .resolved , volume .target , writable = volume .staged
241
+ )
240
242
241
243
def add_writable_file_volume (
242
244
self ,
Original file line number Diff line number Diff line change @@ -100,18 +100,13 @@ def relink_initialworkdir(
100
100
continue
101
101
host_outdir_tgt = os .path .join (host_outdir , vol .target [len (container_outdir ) + 1 :])
102
102
if os .path .islink (host_outdir_tgt ) or os .path .isfile (host_outdir_tgt ):
103
- try :
104
- os .remove (host_outdir_tgt )
105
- except PermissionError :
106
- pass
103
+ subprocess .run (["chmod" , "777" , host_outdir_tgt ], check = True )
104
+ os .remove (host_outdir_tgt )
107
105
elif os .path .isdir (host_outdir_tgt ) and not vol .resolved .startswith ("_:" ):
106
+ subprocess .run (["chmod" , "777" , host_outdir_tgt ], check = True )
108
107
shutil .rmtree (host_outdir_tgt )
109
108
if not vol .resolved .startswith ("_:" ):
110
- try :
111
- os .symlink (vol .resolved , host_outdir_tgt )
112
- except FileExistsError :
113
- pass
114
-
109
+ os .symlink (vol .resolved , host_outdir_tgt )
115
110
116
111
def neverquote (string : str , pos : int = 0 , endpos : int = 0 ) -> Optional [Match [str ]]:
117
112
return None
You can’t perform that action at this time.
0 commit comments