Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Version
Manage
Activity
Members
Plan
Jira
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Analyze
Contributor analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
OSS
Utilities
Version
Commits
fdcc60bf
Verified
Commit
fdcc60bf
authored
1 year ago
by
Volker Schukai
Browse files
Options
Downloads
Patches
Plain Diff
fix: version result always err 1 #5
parent
3957b216
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
source/commandline.go
+16
-3
16 additions, 3 deletions
source/commandline.go
with
16 additions
and
3 deletions
source/commandline.go
+
16
−
3
View file @
fdcc60bf
...
...
@@ -31,7 +31,7 @@ type commandLineOptions struct {
Date
struct
{
}
`command:"date" description:"print the current date and time in the format YYYYMMDDHHMMSS"`
Auto
struct
{
ExitCode
bool
`short:"e" long:"exit-code-if-no-bump" description:"exit code to use if no notable changes are found"
default:"0"
`
ExitCode
bool
`short:"e" long:"exit-code-if-no-bump" description:"exit code to use if no notable changes are found"`
}
`command:"auto" description:"check the git repository and increase the version if necessary. This implies --git"`
Predict
struct
{
}
`command:"predict" description:"predict the next version based on the git history. This implies --git"`
...
...
@@ -86,6 +86,10 @@ func executeCommand() {
_
,
err
=
p
.
Parse
()
if
err
!=
nil
{
if
arguments
.
Verbose
{
fmt
.
Printf
(
"Error: %s
\n
"
,
err
)
}
os
.
Exit
(
1
)
}
...
...
@@ -177,14 +181,23 @@ func executeCommand() {
case
FixCommit
:
command
=
"patch"
case
OtherCommit
:
fmt
.
Println
(
"No notable changes found."
)
fmt
.
Println
(
"If you want to force a version
\n
increase, use the major, minor
\n
or patch command."
)
exitCode
:=
0
printMessage
:=
true
if
arguments
.
Auto
.
ExitCode
{
if
!
arguments
.
Verbose
{
printMessage
=
false
}
exitCode
=
1
}
if
printMessage
{
fmt
.
Println
(
"No notable changes found."
)
fmt
.
Println
(
"If you want to force a version
\n
increase, use the major, minor
\n
or patch command."
)
}
os
.
Exit
(
exitCode
)
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment