Exemplo n.º 1
0
        /// <summary>
        /// Check out SVN or a GIT package.
        /// </summary>
        /// <param name="connection">Connection on which we should be checking this out on</param>
        /// <param name="scPackagePath">The svn path to the package. Basically what you would hand to the rc checkout command. Nohting like "tags" or "trunk" is permitted.</param>
        /// <param name="scRevision">The revision number. A SVN revision number. If blank, then the version associated with the build is checked out.</param>
        /// <returns></returns>
        public static Task <ISSHConnection> CheckoutPackageAsync(this ISSHConnection connection, string scPackagePath, string scRevision, Func <bool> failNow = null, bool dumpOnly = false)
        {
            if (string.IsNullOrWhiteSpace(scPackagePath))
            {
                throw new ArgumentNullException("scPackagePath", "Package must be a valid path to a source control repro!");
            }
            var isGit = scPackagePath.EndsWith(".git");

            return(isGit
                ? connection.CheckoutPackageGitAsync(scPackagePath, scRevision, failNow, dumpOnly)
                : connection.CheckoutPackageSVNAsync(scPackagePath, scRevision, failNow, dumpOnly));
        }