示例#1
0
        public static async Task Main(string[] args)
        {
            InteractiveMode = !(args.Count() > 0 && args[0] == "--script");

            Console.WriteLine("*******************");
            Console.WriteLine("*WoW Addon updater*");
            Console.WriteLine("*******************\n");

            try
            {
#if RELEASE
                var cnf_path = Path.Join(Environment.CurrentDirectory, "config.txt");
#else
                var cnf_path = Path.Join(Path.GetDirectoryName(Assembly.GetEntryAssembly().Location), "dev_config.txt");
#endif

                var addon_updater = new AddonUpdater(cnf_path);
                if (!Directory.Exists(Global.WoWPath))
                {
                    Exit($"World of Warcraft not found in folder '{Global.WoWPath}'!", 1);
                }

                addon_updater.AddonProgressUpdated += addon_updater_AddonProgressUpdated;
                await addon_updater.UpdateAll();

                Exit(addon_updater.Summary(), 0);
            }
            catch (Exception ex)
            {
#if DEBUG
                Exit(ex.ToString(), 1);
#else
                Exit(ex.Message, 1);
#endif
            }
        }