예제 #1
0
        /// <summary>
        ///     Verify that a repository exists, and optionally prompt the user if it does not.
        /// </summary>
        /// <param name="remote">Remote</param>
        /// <param name="repo">Repository to check for</param>
        /// <param name="prompt">Prompt the user to verify that they want to continue</param>
        /// <returns>True if the repository exists, prompting is not desired, or if the user confirms that they want to continue. False otherwise.</returns>
        public static async Task <bool> VerifyAndConfirmRepositoryExistsAsync(IRemote remote, string repo, bool prompt)
        {
            if (!(await remote.RepositoryExistsAsync(repo)))
            {
                Console.WriteLine($"Warning: Could not locate repository '{repo}'. Dependency updates may not happen as expected.");
                if (prompt)
                {
                    return(PromptForYesNo("Continue?"));
                }
            }

            return(true);
        }