private async Task CleanupReactClientAppBuildFolder(string clientAppSubdirPath) { ProcessEx testResult = null; int? testResultExitCode = null; for (int i = 0; i < 3; i++) { try { testResult = ProcessEx.RunViaShell(Output, clientAppSubdirPath, "npx rimraf ./build"); testResultExitCode = testResult.ExitCode; if (testResultExitCode == 0) { return; } } catch { } finally { testResult.Dispose(); } await Task.Delay(3000); } Assert.True(testResultExitCode == 0, ErrorMessages.GetFailedProcessMessage("npx rimraf ./build", Project, testResult)); }
private static async Task <bool> OnSearchHistoryTmuxModeAsync(ConsoleImproved prompt, ConsoleKeyEx key) { ProcessEx tmuxPopup = null; var result = HistoryAPI.ListenForSearchResultAsync((port, token) => { var cssCommand = string.Format(Settings.Default.HistoryPopupCommand, API.Shell.AssemblyLocation, port, token); var tmuxCommand = string.Format(Settings.Default.PopupCommand, cssCommand); // start tmux prompt tmuxPopup = OS.Exec(tmuxCommand); }); await tmuxPopup.WaitForExitAsync(); tmuxPopup.Dispose(); await Task.WhenAny(result, Task.Delay(1000)); if (result.IsCompletedSuccessfully) { prompt.DisplayPrompt(await result); } else { prompt.DisplayPrompt("Error"); } return(false); }
public void Dispose() { Application.Current.MainWindow?.Hide(); try { nitroxEntryPatch.Remove(); } catch (Exception ex) { Log.Error(ex, "Error while disposing the launcher"); } gameProcess?.Dispose(); Server?.Dispose(); LauncherNotifier.Shutdown(); }
public void Dispose() { var attributes = Assembly.GetExecutingAssembly() .GetCustomAttributes <AssemblyMetadataAttribute>(); var serverLogPath = attributes.SingleOrDefault(a => a.Key == "ServerLogPath")?.Value; if (!string.IsNullOrEmpty(serverLogPath)) { File.WriteAllText(serverLogPath, _consoleOut.ToString()); } else { var logDir = Path.Combine(Directory.GetCurrentDirectory(), "artifacts", "logs"); Directory.CreateDirectory(logDir); File.WriteAllText(Path.Combine(logDir, "InteropServer.log"), _consoleOut.ToString()); } _processEx.Dispose(); }
public void Dispose() { _processEx.Dispose(); }