File tree Expand file tree Collapse file tree 2 files changed +4
-12
lines changed Expand file tree Collapse file tree 2 files changed +4
-12
lines changed Original file line number Diff line number Diff line change @@ -90,6 +90,10 @@ impl Cli {
90
90
debug ! ( "Configuring for shell mode..." ) ;
91
91
debug ! ( "Script Path = {:?}" , sub_matcher. value_of( "script" ) ) ;
92
92
debug ! ( "Watch Pattern = {:?}" , sub_matcher. value_of( "watch" ) ) ;
93
+ if !Path :: new ( sub_matcher. value_of ( "script" ) . unwrap ( ) ) . exists ( ) {
94
+ error ! ( "Given path to script does not exist!" ) ;
95
+ std:: process:: exit ( 1 ) ;
96
+ }
93
97
let split = sub_matcher. value_of ( "watch" ) . unwrap ( ) . split ( ',' ) ;
94
98
for s in split {
95
99
watch_patterns. push ( format ! ( "*{}" , s. to_string( ) ) ) ;
Original file line number Diff line number Diff line change 1
1
extern crate assert_cmd;
2
2
extern crate predicates;
3
- use std:: path:: Path ;
4
3
5
4
use assert_cmd:: prelude:: * ;
6
5
//use predicates::prelude::*;
7
6
use std:: process:: Command ;
8
7
9
- #[ test]
10
- fn no_configuration_fails ( ) -> Result < ( ) , Box < dyn std:: error:: Error > > {
11
- let mut cmd = Command :: cargo_bin ( "lightmon" ) ?;
12
- if Path :: new ( "package.json" ) . exists ( ) || Path :: new ( "Cargo.toml" ) . exists ( ) {
13
- Ok ( ( ) )
14
- } else {
15
- cmd. assert ( ) . failure ( ) ;
16
- Ok ( ( ) )
17
- }
18
- }
19
-
20
8
#[ test]
21
9
fn unsupported_configuration_fails ( ) -> Result < ( ) , Box < dyn std:: error:: Error > > {
22
10
let mut cmd = Command :: cargo_bin ( "lightmon" ) ?;
You can’t perform that action at this time.
0 commit comments