Skip to content

Commit eecc865

Browse files
committed
Use binary flag works
1 parent b5dfaf9 commit eecc865

File tree

6 files changed

+43
-36
lines changed

6 files changed

+43
-36
lines changed

cli/preload_steps.go

+11-7
Original file line numberDiff line numberDiff line change
@@ -27,24 +27,28 @@ var prelaodStepsCommand = cli.Command{
2727
cli.UintFlag{
2828
Name: "majors",
2929
Usage: "Include X latest major versions",
30+
Value: 2,
3031
},
3132
cli.UintFlag{
3233
Name: "minors",
3334
Usage: "Include X latest minor versions for each major version",
35+
Value: 1,
3436
},
3537
cli.UintFlag{
3638
Name: "minors-since",
3739
Usage: "Include latest patch version of minors that were released in the last X months",
40+
Value: 2,
3841
},
3942
cli.UintFlag{
40-
Name: "pathces-since",
43+
Name: "patches-since",
4144
Usage: "Include all patch version that were released in the last X months",
45+
Value: 1,
4246
},
4347
},
4448
}
4549

4650
func preloadSteps(c *cli.Context) error {
47-
opts := stepman.DefaultPreloadOpts()
51+
opts := stepman.PreloadOpts{}
4852
shouldCompile := c.Bool("binary")
4953
opts.UseBinaryExecutable = shouldCompile
5054
numMajor := c.Uint("majors")
@@ -55,18 +59,18 @@ func preloadSteps(c *cli.Context) error {
5559
if numMinor != 0 {
5660
opts.NumMinor = numMinor
5761
}
58-
minorsSince := c.Duration("minors-since")
62+
minorsSince := c.Int("minors-since")
5963
if minorsSince != 0 {
60-
opts.LatestMinorsSince = minorsSince
64+
opts.LatestMinorsSinceMonths = minorsSince
6165
}
62-
patchesSince := c.Duration("patches-since")
66+
patchesSince := c.Int("patches-since")
6367
if patchesSince != 0 {
64-
opts.PatchesSince = patchesSince
68+
opts.PatchesSinceMonths = patchesSince
6569
}
6670

6771
logger := log.NewLogger(log.GetGlobalLoggerOpts())
6872
log.Info("Preloading Bitrise maintained Steps...")
69-
log.Printf("Options: %#v", opts)
73+
log.Printf("Options: %#v\n", opts)
7074

7175
if err := stepman.PreloadBitriseSteps(logger, toolkits.GoBuildStep, opts); err != nil {
7276
return err

go.mod

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ require (
99
github.com/bitrise-io/go-utils v1.0.11
1010
github.com/bitrise-io/go-utils/v2 v2.0.0-alpha.21
1111
github.com/bitrise-io/goinp v0.0.0-20240103152431-054ed78518ef
12-
github.com/bitrise-io/stepman v0.0.0-20240430093347-96cb49cf1ac4
12+
github.com/bitrise-io/stepman v0.0.0-20240430102320-8ad0ff039845
1313
github.com/gofrs/uuid v4.3.1+incompatible
1414
github.com/hashicorp/go-version v1.4.0
1515
github.com/ryanuber/go-glob v1.0.0

go.sum

+4
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,10 @@ github.com/bitrise-io/goinp v0.0.0-20240103152431-054ed78518ef h1:R5FOa8RHjqZwMN
1717
github.com/bitrise-io/goinp v0.0.0-20240103152431-054ed78518ef/go.mod h1:27ldH2bkCdYN5CEJ6x92EK+gkd5EcDBkA7dMrSKQFYU=
1818
github.com/bitrise-io/stepman v0.0.0-20240430093347-96cb49cf1ac4 h1:pAQdr9ph8X1Wd0J5AlsVswQy94vI/Hrt1ZqVtMhBV4U=
1919
github.com/bitrise-io/stepman v0.0.0-20240430093347-96cb49cf1ac4/go.mod h1:netRLDQD95IzWZbzmn7CBolzNqH1tErRKS31BrZKt9s=
20+
github.com/bitrise-io/stepman v0.0.0-20240430100943-96e02b19bb69 h1:bPrYZrXdQdXfP5Z6miJiunrOKiDeDrWZcDHL7kAuEVo=
21+
github.com/bitrise-io/stepman v0.0.0-20240430100943-96e02b19bb69/go.mod h1:i2uVyAnNdDNmC5WbsyUiP9ZAePYMucYciHFS/QORf04=
22+
github.com/bitrise-io/stepman v0.0.0-20240430102320-8ad0ff039845 h1:V4mK4tXeiiVReTwdnDU0H6HZ04SfjAqYNHcaK5QSH+4=
23+
github.com/bitrise-io/stepman v0.0.0-20240430102320-8ad0ff039845/go.mod h1:i2uVyAnNdDNmC5WbsyUiP9ZAePYMucYciHFS/QORf04=
2024
github.com/cpuguy83/go-md2man/v2 v2.0.2 h1:p1EgwI/C7NhT0JmVkwCD2ZBK8j4aeHQX2pMHHBfMQ6w=
2125
github.com/cpuguy83/go-md2man/v2 v2.0.2/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o=
2226
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=

vendor/github.com/bitrise-io/stepman/cli/preload_steps.go

+23-24
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vendor/github.com/bitrise-io/stepman/cli/preload_steps_util.go

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vendor/modules.txt

+2-2
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,8 @@ github.com/bitrise-io/go-utils/v2/retryhttp
4545
# github.com/bitrise-io/goinp v0.0.0-20240103152431-054ed78518ef
4646
## explicit; go 1.18
4747
github.com/bitrise-io/goinp/goinp
48-
# github.com/bitrise-io/stepman v0.0.0-20240430093347-96cb49cf1ac4
49-
## explicit; go 1.18
48+
# github.com/bitrise-io/stepman v0.0.0-20240430102320-8ad0ff039845
49+
## explicit; go 1.21
5050
github.com/bitrise-io/stepman/cli
5151
github.com/bitrise-io/stepman/models
5252
github.com/bitrise-io/stepman/stepman

0 commit comments

Comments
 (0)