This repository was archived by the owner on Mar 7, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +17
-9
lines changed Expand file tree Collapse file tree 1 file changed +17
-9
lines changed Original file line number Diff line number Diff line change @@ -18,18 +18,26 @@ static void Main(string[] args)
18
18
Environment . Exit ( 1 ) ;
19
19
}
20
20
21
- var configContent = File . ReadAllText ( args [ 0 ] ) ;
22
- var config = JsonConvert . DeserializeObject < ConfigRoot > ( configContent ) ;
21
+ try
22
+ {
23
+ var configContent = File . ReadAllText ( args [ 0 ] ) ;
24
+ var config = JsonConvert . DeserializeObject < ConfigRoot > ( configContent ) ;
23
25
24
- var dir = Path . GetDirectoryName ( args [ 0 ] ) ;
26
+ var dir = Path . GetDirectoryName ( args [ 0 ] ) ;
25
27
26
- foreach ( var item in config . build )
27
- {
28
- var sourcePath = Path . Combine ( dir , item . source ) ;
29
- var targetPath = Path . Combine ( dir , item . target ) ;
28
+ foreach ( var item in config . build )
29
+ {
30
+ var sourcePath = Path . Combine ( dir , item . source ) ;
31
+ var targetPath = Path . Combine ( dir , item . target ) ;
30
32
31
- var templates = ParseHtml ( sourcePath ) ;
32
- GenerateTypeScript ( config , templates , targetPath ) ;
33
+ var templates = ParseHtml ( sourcePath ) ;
34
+ GenerateTypeScript ( config , templates , targetPath ) ;
35
+ }
36
+ }
37
+ catch ( Exception e )
38
+ {
39
+ Console . WriteLine ( e . ToString ( ) ) ;
40
+ Environment . Exit ( 1 ) ;
33
41
}
34
42
}
35
43
You can’t perform that action at this time.
0 commit comments