File tree Expand file tree Collapse file tree 2 files changed +9
-3
lines changed
Expand file tree Collapse file tree 2 files changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -26,6 +26,7 @@ blake3 = "1.3.1"
2626fern = { version = " 0.6.1" , features = [" colored" ] }
2727chrono = " 0.4.19"
2828dialoguer = " 0.10.1"
29+ shell-words = " 1.1.0"
2930
3031[dev-dependencies ]
3132assert_cmd = " 2.0.4"
Original file line number Diff line number Diff line change @@ -17,9 +17,14 @@ pub fn get_head() -> Result<String> {
1717
1818pub fn get_paths_from_cmd ( paths_cmd : & str ) -> Result < Vec < AbsPath > > {
1919 debug ! ( "Running paths_cmd: {}" , paths_cmd) ;
20- let output = Command :: new ( "sh" )
21- . arg ( "-c" )
22- . arg ( paths_cmd)
20+ if paths_cmd. is_empty ( ) {
21+ return Err ( anyhow:: Error :: msg ( "paths_cmd is empty. Please provide an executable command." ) ) ;
22+ }
23+ let argv = shell_words:: split ( paths_cmd) . context ( "failed to split paths_cmd" ) ?;
24+ debug ! ( "Parsed paths_cmd: {:?}" , argv) ;
25+
26+ let output = Command :: new ( & argv[ 0 ] )
27+ . args ( & argv[ 1 ..] )
2328 . output ( )
2429 . context ( "failed to run provided paths_cmd" ) ?;
2530
You can’t perform that action at this time.
0 commit comments