Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
gek64 committed Dec 22, 2023
1 parent 482f76e commit 8bef919
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 14 deletions.
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@ module redl
go 1.21.4

require (
github.com/gek64/gek v1.1.1-0.20231213065838-ccb663823d94
github.com/gek64/gek v1.1.2-0.20231222091541-e37b3f00c2a9
github.com/urfave/cli/v2 v2.26.0
)

require (
github.com/cpuguy83/go-md2man/v2 v2.0.3 // indirect
github.com/russross/blackfriday/v2 v2.1.0 // indirect
github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673 // indirect
github.com/xrash/smetrics v0.0.0-20231213231151-1d8dd44e695e // indirect
)
10 changes: 4 additions & 6 deletions go.sum
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
github.com/cpuguy83/go-md2man/v2 v2.0.3 h1:qMCsGGgs+MAzDFyp9LpAe1Lqy/fY/qCovCm0qnXZOBM=
github.com/cpuguy83/go-md2man/v2 v2.0.3/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o=
github.com/gek64/gek v1.1.1-0.20231212171036-c563ca8bf4d5 h1:sc8IEwuuhv9ztxMvUkhbIIDxN6gEg6G7R958CKc7w+c=
github.com/gek64/gek v1.1.1-0.20231212171036-c563ca8bf4d5/go.mod h1:84OKdazk9Mi94sDNt70r7Bc1pjRm5BQtN4mPTaLZU8w=
github.com/gek64/gek v1.1.1-0.20231213065838-ccb663823d94 h1:muKRvKVnhHXB4MhGQctnDoJv1yRdp61zah/DIt5JVE8=
github.com/gek64/gek v1.1.1-0.20231213065838-ccb663823d94/go.mod h1:lMjX11RAL+bdrcYglnFoQQFsUXrgR5odUTWLZlg4Mj8=
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/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/xrash/smetrics v0.0.0-20201216005158-039620a65673 h1:bAn7/zixMGCfxrRTfdpNzjtPYqr8smhKouy9mxVdGPU=
github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673/go.mod h1:N3UwUGtsrSj3ccvlPHLoLsHnpR27oXr4ZE984MbSER8=
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=
20 changes: 14 additions & 6 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package main
import (
"fmt"
"github.com/gek64/gek/gDownloader"
"github.com/gek64/gek/gToolbox"
"github.com/urfave/cli/v2"
"log"
"os"
Expand Down Expand Up @@ -58,28 +59,35 @@ func main() {
Usage: "Release Download Tool",
Version: "v2.00",
Flags: flags,
Action: func(ctx *cli.Context) error {
Action: func(ctx *cli.Context) (err error) {
var downloadLink string
var err error

// 获取下载链接
if github_release != "" {
downloadLink, err = internal.GetGithubDownloadLink(github_release, included_parts.Value(), excluded_parts.Value())
if err != nil {
log.Fatalln(err)
return err
}
} else if sourceforge_release != "" {
downloadLink, err = internal.GetSourceForgeDownloadLink(sourceforge_release, included_parts.Value(), excluded_parts.Value())
if err != nil {
log.Fatalln(err)
return err
}
}

// 下载
if downloadLink != "" {
err = gDownloader.Downloader(downloadLink, "", output)
err = gToolbox.CheckToolbox([]string{"curl"})
if err != nil {
log.Fatalln(err)
err := gDownloader.Download(downloadLink, output, "")
if err != nil {
return err
}
} else {
err := gDownloader.DownloadWithCurl(downloadLink, output, "")
if err != nil {
return err
}
}
}
return nil
Expand Down

0 comments on commit 8bef919

Please sign in to comment.