Skip to content

Commit

Permalink
make sure to set the version
Browse files Browse the repository at this point in the history
  • Loading branch information
markbates committed Sep 5, 2018
1 parent 972c6a5 commit 27c6bdd
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 1 deletion.
1 change: 1 addition & 0 deletions cmd/init.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ var initCmd = &cobra.Command{
if len(initOptions.versionFile) != 0 {
run.WithRun(release.WriteVersionFile(&release.Options{
VersionFile: initOptions.versionFile,
Version: "v0.0.1",
}))
}
g, err := makefile.New(&makefile.Options{
Expand Down
3 changes: 3 additions & 0 deletions genny/release/options.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ func (opts *Options) Validate() error {
return errors.New("you must set a GITHUB_TOKEN")
}
}
if len(opts.Version) == 0 {
opts.Version = "v0.0.1"
}
v, err := semver.NewVersion(opts.Version)
if err != nil {
return errors.WithStack(err)
Expand Down
2 changes: 1 addition & 1 deletion genny/release/options_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ func Test_Options_Validate(t *testing.T) {
{&Options{}, false},
{&Options{GitHubToken: "foo", Version: "v1.0.0"}, true},
{&Options{GitHubToken: "", Version: "v1.0.0"}, false},
{&Options{GitHubToken: "foo", Version: ""}, false},
{&Options{GitHubToken: "foo", Version: ""}, true},
}

for _, tt := range table {
Expand Down

0 comments on commit 27c6bdd

Please sign in to comment.