Skip to content

Commit 48eca6a

Browse files
feat(cmd): add update flag
1 parent bef1616 commit 48eca6a

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

cmd/semantic-release/main.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import (
77
"fmt"
88
"github.com/semantic-release/go-semantic-release"
99
"github.com/semantic-release/go-semantic-release/condition"
10+
"github.com/semantic-release/go-semantic-release/update"
1011
"io/ioutil"
1112
"log"
1213
"os"
@@ -31,6 +32,7 @@ func main() {
3132
dry := flag.Bool("dry", false, "do not create release")
3233
vFile := flag.Bool("vf", false, "create a .version file")
3334
showVersion := flag.Bool("version", false, "outputs the semantic-release version")
35+
updateFile := flag.String("update", "", "updates the version of a certain file")
3436
flag.Parse()
3537

3638
if *showVersion {
@@ -92,5 +94,9 @@ func main() {
9294
exitIfError(ioutil.WriteFile(".version", []byte(newVer.String()), 0644))
9395
}
9496

97+
if *updateFile != "" {
98+
exitIfError(update.Apply(*updateFile, newVer.String()))
99+
}
100+
95101
logger.Println("done.")
96102
}

0 commit comments

Comments
 (0)