File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -64,8 +64,9 @@ impl DockerClient {
6464 }
6565
6666 fn set_workdir ( command : & mut Command ) {
67- let binding = std:: env:: current_dir ( ) . unwrap ( ) ;
68- let current_dir = binding. to_str ( ) . unwrap ( ) ;
67+ let path = std:: env:: current_dir ( ) . expect ( "Failed to get current directory" ) ;
68+ let absolute_path = path. canonicalize ( ) . expect ( "Failed to get current directory" ) ;
69+ let current_dir = absolute_path. to_str ( ) . expect ( "Failed to get current directory" ) ;
6970
7071 command
7172 . arg ( "-v" )
@@ -167,7 +168,8 @@ mod tests {
167168 assert_eq ! ( command. get_program( ) , "docker" ) ;
168169
169170 let binding = current_dir ( ) . unwrap ( ) ;
170- let current_dir = binding. to_str ( ) . unwrap ( ) ;
171+ let absolute_path = binding. canonicalize ( ) . unwrap ( ) ;
172+ let current_dir = absolute_path. to_str ( ) . unwrap ( ) ;
171173
172174 let args: Vec < & OsStr > = command. get_args ( ) . collect ( ) ;
173175
You can’t perform that action at this time.
0 commit comments