File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -139,21 +139,21 @@ pub(crate) fn options() -> Result<Options, OptionError> {
139139 . to_owned ( ) ;
140140 let output_base = {
141141 let external = std:: path:: Path :: new ( & current_dir) . join ( "external" ) ;
142- match std:: fs:: read_link ( external) {
143- Ok ( target ) => target
142+ match std:: fs:: canonicalize ( & external) {
143+ Ok ( canonical ) => canonical
144144 . parent ( )
145- . unwrap_or ( & target)
146- . to_str ( )
145+ . and_then ( |p| p. to_str ( ) )
147146 . unwrap_or ( & current_dir)
148147 . to_owned ( ) ,
149- Err ( _) => {
150- let cwd = std :: path :: Path :: new ( & current_dir ) ;
151- cwd . parent ( )
148+ Err ( _) => match std :: fs :: canonicalize ( & current_dir ) {
149+ Ok ( canonical ) => canonical
150+ . parent ( )
152151 . and_then ( |p| p. parent ( ) )
153152 . and_then ( |p| p. to_str ( ) )
154153 . unwrap_or ( & current_dir)
155- . to_owned ( )
156- }
154+ . to_owned ( ) ,
155+ Err ( _) => current_dir. clone ( ) ,
156+ } ,
157157 }
158158 } ;
159159
You can’t perform that action at this time.
0 commit comments