Skip to content

Commit 0b29bd6

Browse files
feat: add allow-initial-development-versions flag
1 parent 35ce827 commit 0b29bd6

File tree

2 files changed

+32
-26
lines changed

2 files changed

+32
-26
lines changed

pkg/config/config.go

Lines changed: 28 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -16,20 +16,21 @@ type (
1616

1717
// Config is a complete set of app configuration
1818
Config struct {
19-
Token string
20-
Slug string
21-
Changelog string
22-
Ghr bool
23-
Noci bool
24-
Dry bool
25-
Vf bool
26-
Update string
27-
GheHost string
28-
Gitlab GitlabConfig
29-
Prerelease bool
30-
TravisCom bool
31-
BetaRelease BetaRelease
32-
Match string
19+
Token string
20+
Slug string
21+
Changelog string
22+
Ghr bool
23+
Noci bool
24+
Dry bool
25+
Vf bool
26+
Update string
27+
GheHost string
28+
Gitlab GitlabConfig
29+
Prerelease bool
30+
TravisCom bool
31+
BetaRelease BetaRelease
32+
Match string
33+
AllowInitialDevelopmentVersions bool
3334
}
3435

3536
BetaRelease struct {
@@ -40,18 +41,19 @@ type (
4041
// NewConfig returns a new Config instance
4142
func NewConfig(c *cli.Context) *Config {
4243
conf := &Config{
43-
Token: c.String("token"),
44-
Slug: c.String("slug"),
45-
Changelog: c.String("changelog"),
46-
Ghr: c.Bool("ghr"),
47-
Noci: c.Bool("noci"),
48-
Dry: c.Bool("dry"),
49-
Vf: c.Bool("vf"),
50-
Update: c.String("update"),
51-
GheHost: c.String("ghe-host"),
52-
Prerelease: c.Bool("prerelease"),
53-
TravisCom: c.Bool("travis-com"),
54-
Match: c.String("match"),
44+
Token: c.String("token"),
45+
Slug: c.String("slug"),
46+
Changelog: c.String("changelog"),
47+
Ghr: c.Bool("ghr"),
48+
Noci: c.Bool("noci"),
49+
Dry: c.Bool("dry"),
50+
Vf: c.Bool("vf"),
51+
Update: c.String("update"),
52+
GheHost: c.String("ghe-host"),
53+
Prerelease: c.Bool("prerelease"),
54+
TravisCom: c.Bool("travis-com"),
55+
Match: c.String("match"),
56+
AllowInitialDevelopmentVersions: c.Bool("allow-initial-development-versions"),
5557
Gitlab: GitlabConfig{
5658
BaseURL: c.String("gitlab-base-url"),
5759
ProjectID: c.String("gitlab-project-id"),

pkg/config/flags.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,4 +69,8 @@ var CliFlags = []cli.Flag{
6969
Usage: "Gitlab project unique id",
7070
EnvVars: []string{"CI_PROJECT_ID"},
7171
},
72+
&cli.BoolFlag{
73+
Name: "allow-initial-development-versions",
74+
Usage: "semantic-release will start your initial development release at 0.1.0",
75+
},
7276
}

0 commit comments

Comments
 (0)