コード例 #1
0
        public static string GetGitHubName(this GitRepository repository)
        {
            ControlFlow.Assert(repository.IsGitHubRepository(), "repository.IsGitHubRepository()");

            return(repository.Identifier.Split('/')[1]);
        }
コード例 #2
0
 public override object GetValue(MemberInfo member, object instance)
 {
     return(GitRepository.FromLocalDirectory(NukeBuild.RootDirectory));
 }
コード例 #3
0
 public static bool IsOnHotfixBranch(this GitRepository repository)
 {
     return(repository.Branch?.StartsWithOrdinalIgnoreCase("hotfix/") ?? false);
 }
コード例 #4
0
 public static bool IsGitHubRepository(this GitRepository repository)
 {
     return(repository != null && repository.Endpoint.EqualsOrdinalIgnoreCase("github.com"));
 }
コード例 #5
0
        // public static bool IsOnBugfixBranch(this GitRepository repository)
        // {
        //     return repository.Branch?.StartsWithOrdinalIgnoreCase("feature/fix-") ?? false;
        // }

        public static bool IsOnReleaseBranch(this GitRepository repository)
        {
            return(repository.Branch?.StartsWithOrdinalIgnoreCase("release/") ?? false);
        }
コード例 #6
0
 public static bool IsOnDevelopBranch(this GitRepository repository)
 {
     return((repository.Branch?.EqualsOrdinalIgnoreCase("dev") ?? false) ||
            (repository.Branch?.EqualsOrdinalIgnoreCase("develop") ?? false) ||
            (repository.Branch?.EqualsOrdinalIgnoreCase("development") ?? false));
 }
コード例 #7
0
 public static bool IsOnMasterBranch(this GitRepository repository)
 {
     return(repository.Branch?.EqualsOrdinalIgnoreCase("master") ?? false);
 }
コード例 #8
0
        private static string GetMethod([CanBeNull] string relativePath, GitHubItemType itemType, GitRepository repository)
        {
            var absolutePath = repository.LocalDirectory != null && relativePath != null
                ? PathConstruction.NormalizePath(Path.Combine(repository.LocalDirectory, relativePath))
                : null;

            if (itemType == GitHubItemType.Directory || Directory.Exists(absolutePath) || relativePath == null)
            {
                return("tree");
            }

            if (itemType == GitHubItemType.File || File.Exists(absolutePath))
            {
                return("blob");
            }

            return(null);
        }
コード例 #9
0
 public override object GetStaticValue()
 {
     return(Value = Value
                    ?? ControlFlow.SuppressErrors(() =>
                                                  GitRepository.FromLocalDirectory(NukeBuild.Instance.RootDirectory, Branch, Remote.NotNull())));
 }