bool GitRepoIsNotBlank(string solutionFullPath) { var executionResult = BashHelper.ExecuteBashCommand($"cd {solutionFullPath};git log --oneline | wc -l"); var commitsNumberBiggerThanZero = int.Parse(executionResult.output.Trim()) > 0; return(executionResult.code == 0 && commitsNumberBiggerThanZero); }
protected override void Run() { using (var monitor = IdeApp.Workbench.ProgressMonitors.GetToolOutputProgressMonitor(true)) { monitor.BeginTask(1); try { var solution = ProjectOperations.CurrentSelectedSolution; var solutionFullPath = solution.BaseDirectory.FullPath; monitor.Log.WriteLine($"Archiving {solutionFullPath}"); var result = BashHelper.ExecuteBashCommand($"cd {solutionFullPath};git archive --format zip --output \"{solution.Name}_{DateTime.Now.ToArhiveTimestamp()}.zip\" HEAD"); monitor.ReportSuccess($"Git archive return code: {result.code} {Environment.NewLine}Git archive log: {result}"); } catch (Exception ex) { monitor.ReportError($"Archiving failed with: ", ex); } finally { monitor.EndTask(); } } }
public Profile GetProfile() { var command = CreateCommand(ProfileCommand, $"list"); var result = BashHelper.ExecuteBashCommand(command); string[] lines = Regex.Split(result.Output, "\n"); return(Profile.ParseFromString(lines)); }
public SessionAnalytics GetSessionAnalytics(string ownerName, string name, DateTime startDate, DateTime endDate) { var command = CreateCommand(AnalyticsCommand, $"sessions --app \"{ownerName}/{name}\" -s \"{endDate.ToShortDateString()}\" -e \"{startDate.ToShortDateString()}\""); var result = BashHelper.ExecuteBashCommand(command); string[] lines = Regex.Split(result.Output, "\n"); return(SessionAnalytics.ParseFromString(lines)); }
public Application GetApplicationDetails(string applicationOwner, string applicationName) { Application application = new Application(); var command = CreateCommand(AppsCommand, $"show --app \"{applicationOwner}/{applicationName}\""); var result = BashHelper.ExecuteBashCommand(command); string[] lines = Regex.Split(result.Output, "\n"); application = Application.ParseFromString(lines); return(application); }
public Application CreateApplication(string displayName, string os, string platform) { Application application = new Application(); var command = CreateCommand(AppsCommand, $"create -d \"{displayName}\" -o \"{os}\" -p \"{platform}\""); var result = BashHelper.ExecuteBashCommand(command); string[] lines = Regex.Split(result.Output, "\n"); application = Application.ParseFromString(lines); ApplicationsChanged?.Invoke(this, new EventArgs()); return(application); }
public Application UpdateApplication(string ownerName, string name, string displayName, string description) { Application application = new Application(); var command = CreateCommand(AppsCommand, $"update --app \"{ownerName}/{name}\" -n \"{name}\" -d \"{displayName}\" -description \"{description}\""); var result = BashHelper.ExecuteBashCommand(command); string[] lines = Regex.Split(result.Output, "\n"); application = Application.ParseFromString(lines); ApplicationsChanged?.Invoke(this, new EventArgs()); return(application); }
public List <Application> GetApplications() { List <Application> applications = new List <Application>(); var command = CreateCommand(AppsCommand, "list"); var result = BashHelper.ExecuteBashCommand(command); string[] lines = Regex.Split(result.Output, "\n"); foreach (var line in lines) { if (!string.IsNullOrEmpty(line)) { applications.Add(Application.ParseFromString(line)); } } return(applications); }
public void Logout() { var command = CreateCommand(ProfileCommand, $"logout"); BashHelper.ExecuteBashCommand(command); }