File tree 1 file changed +5
-3
lines changed
1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -64,8 +64,9 @@ impl DockerClient {
64
64
}
65
65
66
66
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" ) ;
69
70
70
71
command
71
72
. arg ( "-v" )
@@ -167,7 +168,8 @@ mod tests {
167
168
assert_eq ! ( command. get_program( ) , "docker" ) ;
168
169
169
170
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 ( ) ;
171
173
172
174
let args: Vec < & OsStr > = command. get_args ( ) . collect ( ) ;
173
175
You can’t perform that action at this time.
0 commit comments