adjustment

This commit is contained in:
Songmu 2019-05-07 01:28:37 +09:00
parent 671b1d2b23
commit 015f3d64f2
3 changed files with 3 additions and 8 deletions

View file

@ -60,7 +60,7 @@ func (g *getter) get(argURL string) error {
return err
}
if remote.IsValid() == false {
if !remote.IsValid() {
return fmt.Errorf("Not a valid repository: %s", u)
}

View file

@ -81,7 +81,7 @@ func doList(c *cli.Context) error {
}
for _, repo := range repos {
if reposCount[repo.RelPath] > 1 && repo.IsUnderPrimaryRoot() == false {
if reposCount[repo.RelPath] > 1 && !repo.IsUnderPrimaryRoot() {
continue
}

View file

@ -32,13 +32,8 @@ func (repo *GitHubRepository) IsValid() bool {
if strings.HasPrefix(repo.url.Path, "/blog/") {
return false
}
pathComponents := strings.Split(strings.Trim(repo.url.Path, "/"), "/")
if len(pathComponents) < 2 {
return false
}
return true
return len(pathComponents) >= 2
}
func (repo *GitHubRepository) VCS() (*VCSBackend, *url.URL) {