Skip to content

Commit

Permalink
feat(cmd): add update flag
Browse files Browse the repository at this point in the history
  • Loading branch information
christophwitzko committed Apr 13, 2017
1 parent bef1616 commit 48eca6a
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions cmd/semantic-release/main.go
Expand Up @@ -7,6 +7,7 @@ import (
"fmt"
"github.com/semantic-release/go-semantic-release"
"github.com/semantic-release/go-semantic-release/condition"
"github.com/semantic-release/go-semantic-release/update"
"io/ioutil"
"log"
"os"
Expand All @@ -31,6 +32,7 @@ func main() {
dry := flag.Bool("dry", false, "do not create release")
vFile := flag.Bool("vf", false, "create a .version file")
showVersion := flag.Bool("version", false, "outputs the semantic-release version")
updateFile := flag.String("update", "", "updates the version of a certain file")
flag.Parse()

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

if *updateFile != "" {
exitIfError(update.Apply(*updateFile, newVer.String()))
}

logger.Println("done.")
}

0 comments on commit 48eca6a

Please sign in to comment.