Skip to content

Commit ca8b874

Browse files
authored
feat(builder/plan): add build variant flag (#137)
1 parent 5d36f02 commit ca8b874

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

pkg/cli/plan.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,10 @@ func planCmd() *cli2.Command {
3838
Name: "sha",
3939
Usage: "override commit SHA of specified git branch/tag",
4040
},
41+
&cli2.IntFlag{
42+
Name: "build-variant",
43+
Usage: "build variant to add to the end of the version string",
44+
},
4145
&cli2.StringFlag{
4246
Name: "format",
4347
Aliases: []string{"f"},
@@ -90,6 +94,7 @@ func planAction(c *cli2.Context, opts *Options) error {
9094
EmacsRepo: c.String("emacs-repo"),
9195
Ref: ref,
9296
SHAOverride: c.String("sha"),
97+
BuildVariant: c.Int("build-variant"),
9398
OutputDir: c.String("output-dir"),
9499
TestBuild: c.String("test-build"),
95100
TestBuildType: plan.Prerelease,

pkg/plan/create.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ type Options struct {
3535
EmacsRepo string
3636
Ref string
3737
SHAOverride string
38+
BuildVariant int
3839
OutputDir string
3940
TestBuild string
4041
TestBuildType TestBuildType
@@ -95,6 +96,12 @@ func Create(ctx context.Context, opts *Options) (*Plan, error) { //nolint:funlen
9596
releaseName = "Emacs." + version
9697
}
9798

99+
if opts.BuildVariant != 0 {
100+
variant := strconv.Itoa(opts.BuildVariant)
101+
absoluteVersion += "-" + variant
102+
releaseName += "-" + variant
103+
}
104+
98105
// Attempt to get the macOS SDK version from the environment, if it's not
99106
// available, use the version from the system.
100107
targetMacOSVersion := osInfo.DistinctSDKVersion()

0 commit comments

Comments
 (0)