static void Main(string[] args) { if (args.Length < 2) { Console.WriteLine($"Usage: FakeBuilder [platform] [target]"); return; } var platformName = args[0]; var targetName = args[1]; var platformType = PlatfomHelper.GetPlatformType(platformName); if (platformType == null) { Console.WriteLine($"{platformName} was not found."); return; } var currentPlatform = PlatfomHelper.GetPlatformInstance(platformType, args); currentPlatform.Run(targetName); Console.WriteLine(); if (System.Diagnostics.Debugger.IsAttached) { Console.WriteLine("Hit any key to exit."); Console.ReadKey(); } }
private bool execute(string cmd) { var result = true; var returnValue = PlatfomHelper.Execute(this.installer, cmd).GetAwaiter().GetResult(); result = returnValue == 0; return(result); }
public virtual void GitLfs(IEnumerable <string> args) { if (args.Count() < 2) { return; } var user = args.ElementAt(0); var pass = args.ElementAt(1); var url = args.ElementAt(2); var result = PlatfomHelper.Execute("git", $"lfs pull \"https://{user}:{pass}@{url}\""); if (result.Result != 0) { throw new Exception($"Not valid parameters usr:{user} pass:{pass} url:{url}"); } }