Esempio n. 1
0
 public static void Main(string[] arguments)
 {
     try
     {
         var args = arguments.Select(a => a.ToLowerInvariant());
         ProjectBuilder.ProductionMode = args.Any(a => a == "production");
         if (args.Any(a => a == "watch"))
         {
             if (!File.Exists(BuildCache.CacheFilename))
             {
                 Console.WriteLine("No build cache found, running full build...");
                 RunFullBuild();
             }
             var watchBuilder = new WatchBuilder();
             watchBuilder.StartWatching();
         }
         else
         {
             RunFullBuild();
         }
     }
     catch (Exception ex)
     {
         var lastColor = Console.ForegroundColor;
         Console.ForegroundColor = ConsoleColor.Red;
         Console.Error.WriteLine($"Unexpected Error: {ex.Message}");
         Console.ForegroundColor = lastColor;
         throw;
     }
 }
Esempio n. 2
0
 public static void Main(string[] args)
 {
     try
     {
         if (args.Length > 0 && args[0].ToLowerInvariant() == "watch")
         {
             if (!File.Exists(BuildCache.CacheFilename))
             {
                 Console.WriteLine("No build cache found, running full build...");
                 RunFullBuild();
             }
             var watchBuilder = new WatchBuilder();
             watchBuilder.StartWatching();
         }
         else
         {
             RunFullBuild();
         }
     }
     catch (Exception ex)
     {
         Console.ForegroundColor = ConsoleColor.Red;
         Console.Error.WriteLine($"Unexpected Error: {ex.Message}");
         throw;
     }
 }