Skip to content

Commit

Permalink
fix: matched pattern when pattern is empty
Browse files Browse the repository at this point in the history
  • Loading branch information
amazingandyyy committed Apr 17, 2022
1 parent af27bb7 commit 6260b06
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.0.1
0.0.2
Binary file modified bin/gofuzzyclone
Binary file not shown.
6 changes: 3 additions & 3 deletions gofuzzyclone.go
Original file line number Diff line number Diff line change
Expand Up @@ -246,12 +246,12 @@ func main() {
}

if *wildcard_pattern == "" {
fmt.Printf("Search for what wildcard pattern? (Press [Enter] to skip) ")
fmt.Printf("wildcard pattern: (Press [Enter] to skip) ")
fmt.Scanf("%s", wildcard_pattern)
}

if *regex_pattern == "" {
fmt.Printf("Search for what regex pattern? (Press [Enter] to skip) ")
fmt.Printf("regex pattern: (Press [Enter] to skip) ")
fmt.Scanf("%s", regex_pattern)
}

Expand All @@ -271,7 +271,7 @@ func main() {
for _, repo := range all_repos {
wildcard_matched, _ := regexp.MatchString(wildCardToRegexp(*wildcard_pattern), repo.GetName())
regex_matched, _ := regexp.MatchString(*regex_pattern, repo.GetName())
if wildcard_matched || regex_matched {
if (wildcard_matched && *wildcard_pattern != "") || (regex_matched && *regex_pattern != "") {
all_repos_matched = append(all_repos_matched, repo)
}
}
Expand Down

0 comments on commit 6260b06

Please sign in to comment.