using CommandLineWrapper; public class JVCSWorkspace { private string? _workspaceDirectory; public async Task InitializeAsync(string directory) { // If the specified directory does not exist, create it if (!Directory.Exists(directory)) Directory.CreateDirectory(directory); // Invoke command to get workspace directory var result = await JVCSCommandInvoker.Invoke(Constants.CommandParameterGenerator.GetWorkspaceDirectory(), directory); var currentWorkspace = result.StandardOutput; // Check if the obtained workspace directory is valid (not empty and exists) if (string.IsNullOrWhiteSpace(currentWorkspace) && Directory.Exists(currentWorkspace)) { _workspaceDirectory = currentWorkspace; } else { // If the workspace is invalid, initialize a new workspace await JVCSCommandInvoker.Invoke(Constants.CommandParameterGenerator.Initialize()); } } // Login to a upstream vault public async Task Login(string account, string upstream) { await JVCSCommandInvoker.Invoke(Constants.CommandParameterGenerator.Login(account, upstream)); } }