Exemple #1
0
 /// <summary>
 /// Set the driver git to replace github api driver.
 /// </summary>
 protected void SetupDriverGit(string uri)
 {
     driverGit = new DriverGit(new ConfigRepositoryVcs {
         Uri = uri
     }, IO, Config, Process);
     driverGit.Initialize();
 }
Exemple #2
0
        protected virtual bool AttemptCloneFallback()
        {
            isPrivate = true;

            try
            {
                // If this repository may be private (hard to say for sure,
                // GitHub returns 404 for private repositories) and we
                // cannot ask for authentication credentials (because we
                // are not interactive) then we fallback to GitDriver.
                SetupDriverGit(GenerateSSHUri());
            }
            catch (RuntimeException ex)
            {
                driverGit = null;
                IO.WriteError($"<error>Failed to clone the {GenerateSSHUri()} repository, try running in interactive mode so that you can enter your GitHub credentials. Exception: {ex.Message}</error>");
                throw;
            }

            return(true);
        }