Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
gek64 committed Feb 28, 2024
1 parent 99e2b9b commit 00f2528
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 16 deletions.
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ module redl
go 1.21.4

require (
github.com/gek64/gek v1.1.2-0.20231222091541-e37b3f00c2a9
github.com/urfave/cli/v2 v2.26.0
github.com/gek64/gek v1.1.2-0.20240122081904-9f44691c0810
github.com/urfave/cli/v2 v2.27.1
)

require (
Expand Down
4 changes: 4 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,13 @@ github.com/cpuguy83/go-md2man/v2 v2.0.3 h1:qMCsGGgs+MAzDFyp9LpAe1Lqy/fY/qCovCm0q
github.com/cpuguy83/go-md2man/v2 v2.0.3/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o=
github.com/gek64/gek v1.1.2-0.20231222091541-e37b3f00c2a9 h1:3+foBBZXBQm3ZugExmeO9EdQkn27GyP+f0Er61WxhqU=
github.com/gek64/gek v1.1.2-0.20231222091541-e37b3f00c2a9/go.mod h1:oalulJSH0OM6LRbjGwpw305/d7h9VE5P1wDbDR0KUyQ=
github.com/gek64/gek v1.1.2-0.20240122081904-9f44691c0810 h1:7NmGfZLYP3no24WA7xookJK5BEA6IgoqJEOC48Kt4rY=
github.com/gek64/gek v1.1.2-0.20240122081904-9f44691c0810/go.mod h1:35dDRHKelCrseBkA6Gjfg9FPOQhAVD/JluMzGqeQ5z8=
github.com/russross/blackfriday/v2 v2.1.0 h1:JIOH55/0cWyOuilr9/qlrm0BSXldqnqwMsf35Ld67mk=
github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
github.com/urfave/cli/v2 v2.26.0 h1:3f3AMg3HpThFNT4I++TKOejZO8yU55t3JnnSr4S4QEI=
github.com/urfave/cli/v2 v2.26.0/go.mod h1:8qnjx1vcq5s2/wpsqoZFndg2CE5tNFyrTvS6SinrnYQ=
github.com/urfave/cli/v2 v2.27.1 h1:8xSQ6szndafKVRmfyeUMxkNUJQMjL1F2zmsZ+qHpfho=
github.com/urfave/cli/v2 v2.27.1/go.mod h1:8qnjx1vcq5s2/wpsqoZFndg2CE5tNFyrTvS6SinrnYQ=
github.com/xrash/smetrics v0.0.0-20231213231151-1d8dd44e695e h1:+SOyEddqYF09QP7vr7CgJ1eti3pY9Fn3LHO1M1r/0sI=
github.com/xrash/smetrics v0.0.0-20231213231151-1d8dd44e695e/go.mod h1:N3UwUGtsrSj3ccvlPHLoLsHnpR27oXr4ZE984MbSER8=
37 changes: 23 additions & 14 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,24 +11,31 @@ import (
)

func main() {
var github_release string
var sourceforge_release string
var github string
var gitlab string
var sourceforge string
var included_parts cli.StringSlice
var excluded_parts cli.StringSlice
var output string

flags := []cli.Flag{
&cli.StringFlag{
Name: "github_repository",
Aliases: []string{"gr"},
Usage: "set github release url",
Destination: &github_release,
Name: "github",
Aliases: []string{"gh"},
Usage: "set github repo url",
Destination: &github,
},
&cli.StringFlag{
Name: "sourceforge_release",
Aliases: []string{"sr"},
Usage: "set sourceforge release url",
Destination: &sourceforge_release,
Name: "gitlab",
Aliases: []string{"gl"},
Usage: "set gitlab repo url",
Destination: &gitlab,
},
&cli.StringFlag{
Name: "sourceforge",
Aliases: []string{"sf"},
Usage: "set sourceforge repo url",
Destination: &sourceforge,
},
&cli.StringSliceFlag{
Name: "included_parts",
Expand Down Expand Up @@ -63,13 +70,15 @@ func main() {
var downloadLink string

// 获取下载链接
if github_release != "" {
downloadLink, err = internal.GetGithubDownloadLink(github_release, included_parts.Value(), excluded_parts.Value())
if github != "" {
downloadLink, err = internal.GetGithubDownloadLink(github, included_parts.Value(), excluded_parts.Value())
if err != nil {
return err
}
} else if sourceforge_release != "" {
downloadLink, err = internal.GetSourceForgeDownloadLink(sourceforge_release, included_parts.Value(), excluded_parts.Value())
} else if gitlab != "" {
fmt.Println("download release from gitlab is under development")
} else if sourceforge != "" {
downloadLink, err = internal.GetSourceForgeDownloadLink(sourceforge, included_parts.Value(), excluded_parts.Value())
if err != nil {
return err
}
Expand Down

0 comments on commit 00f2528

Please sign in to comment.