private void OnUpdate() { if (patchCreator == null) { EditorApplication.update -= OnUpdate; return; } string log = patchCreator.FetchLog(); while (log != null) { Debug.Log(log); log = patchCreator.FetchLog(); } if (!patchCreator.IsRunning) { if (patchCreator.Result == PatchResult.Failed) { Debug.Log("<b>Operation failed...</b>"); } else { Debug.Log("<b>Operation successful...</b>"); } patchCreator = null; EditorApplication.update -= OnUpdate; } }
private static void LogPatchCreatorToConsole(PatchCreator patchCreator) { string log = patchCreator.FetchLog(); while (log != null) { LogToConsole(log); log = patchCreator.FetchLog(); } }
private static void CreatePatch() { string prevRoot = GetArgument("prevRoot"); PatchCreator patchCreator = new PatchCreator(GetArgument("root"), GetArgument("out"), GetArgument("name"), GetArgument("version")). LoadIgnoredPathsFromFile(GetArgument("ignoredPaths")).CreateRepairPatch(!HasArgument("dontCreateRepairPatch")). CreateIncrementalPatch(prevRoot != null, prevRoot).SilentMode(HasArgument("silent")); bool hasStarted = patchCreator.Run(); if (hasStarted) { while (patchCreator.IsRunning) { Thread.Sleep(100); string log = patchCreator.FetchLog(); while (log != null) { LogToConsole(log); log = patchCreator.FetchLog(); } } if (patchCreator.Result == PatchResult.Failed) { Console.WriteLine("\nOperation failed..."); } else { Console.WriteLine("\nOperation successful..."); } } else { Console.WriteLine("\nOperation could not be started; maybe it is already executing?"); } }