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(
236236 """Append volume a file/dir mapping to the runtime option list."""
237237 if not volume .resolved .startswith ("_:" ):
238238 _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+ )
240242
241243 def add_writable_file_volume (
242244 self ,
Original file line number Diff line number Diff line change @@ -100,18 +100,13 @@ def relink_initialworkdir(
100100 continue
101101 host_outdir_tgt = os .path .join (host_outdir , vol .target [len (container_outdir ) + 1 :])
102102 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 )
107105 elif os .path .isdir (host_outdir_tgt ) and not vol .resolved .startswith ("_:" ):
106+ subprocess .run (["chmod" , "777" , host_outdir_tgt ], check = True )
108107 shutil .rmtree (host_outdir_tgt )
109108 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 )
115110
116111def neverquote (string : str , pos : int = 0 , endpos : int = 0 ) -> Optional [Match [str ]]:
117112 return None
You can’t perform that action at this time.
0 commit comments