-
-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
(Closed #4) Added -include-account option
- Loading branch information
Showing
5 changed files
with
114 additions
and
42 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,8 @@ | ||
package model | ||
|
||
type Options struct { | ||
Proxy string | ||
UseTor bool | ||
Output string | ||
Proxy string | ||
UseTor bool | ||
Output string | ||
IncludeAccount bool | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
package modules | ||
|
||
import ( | ||
"fmt" | ||
"strings" | ||
|
||
"github.com/hahwul/gitls/pkg/model" | ||
) | ||
|
||
// CheckAccount is repo list of accounts in target | ||
func CheckAccount(s string, options model.Options) { | ||
str := strings.Split(s, "/") | ||
size := len(str) // 4 is user/org , 5 is repository | ||
if size == 4 { | ||
if strings.Contains(str[2], "github") { | ||
GetRepoListFromIncludeAccount(str[3], str[2], options) | ||
} else if strings.Contains(str[2], "gitlab") { | ||
// TODO gitlab getting repos | ||
} | ||
} else if size == 5 { | ||
fmt.Println(s) | ||
} | ||
} | ||
|
||
// CheckURL is repo list of target | ||
func CheckURL(s string, options model.Options) { | ||
str := strings.Split(s, "/") | ||
size := len(str) // 4 is user/org , 5 is repository | ||
if size == 4 { | ||
if strings.Contains(str[2], "github") { | ||
GetRepoListFromUser(str[3], str[2], options) | ||
} else if strings.Contains(str[2], "gitlab") { | ||
// TODO gitlab getting repos | ||
} | ||
} else if size == 5 { | ||
fmt.Println(s) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.