Skip to content
This repository was archived by the owner on Mar 7, 2024. It is now read-only.

Commit e15a8bb

Browse files
committed
컴파일 에러를 stdout으로 출력
1 parent c21e0e9 commit e15a8bb

File tree

1 file changed

+17
-9
lines changed

1 file changed

+17
-9
lines changed

Compiler/Program.cs

Lines changed: 17 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -18,18 +18,26 @@ static void Main(string[] args)
1818
Environment.Exit(1);
1919
}
2020

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);
2325

24-
var dir = Path.GetDirectoryName(args[0]);
26+
var dir = Path.GetDirectoryName(args[0]);
2527

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);
3032

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);
3341
}
3442
}
3543

0 commit comments

Comments
 (0)