File tree Expand file tree Collapse file tree 1 file changed +12
-6
lines changed Expand file tree Collapse file tree 1 file changed +12
-6
lines changed Original file line number Diff line number Diff line change @@ -66,13 +66,19 @@ pub mod runners {
6666 exit ( 1 ) ;
6767 }
6868 } ;
69- let path: String = if cfg ! ( windows) {
70- String :: from ( matches. value_of ( "INPUT" ) . unwrap ( ) )
71- } else {
72- matches
73- . value_of ( "INPUT" )
69+ let path: String = if matches. value_of ( "INPUT" ) . unwrap ( ) . contains ( '~' ) {
70+ home_dir ( )
71+ . expect ( "Could not find home directory." )
72+ . join (
73+ Path :: new ( matches. value_of ( "INPUT" ) . unwrap ( ) )
74+ . strip_prefix ( "~" )
75+ . expect ( "Could not strip shortcut." ) ,
76+ )
77+ . to_str ( )
7478 . unwrap ( )
75- . replace ( "~" , home_dir ( ) . unwrap ( ) . to_str ( ) . unwrap ( ) )
79+ . to_string ( )
80+ } else {
81+ String :: from ( matches. value_of ( "INPUT" ) . unwrap ( ) )
7682 } ;
7783 watcher. watch ( & path, RecursiveMode :: Recursive ) . unwrap ( ) ;
7884 println ! ( "Watching for changes in {}..." , path) ;
You can’t perform that action at this time.
0 commit comments