Skip to content

Commit

Permalink
feat: Added a version command
Browse files Browse the repository at this point in the history
  • Loading branch information
Jeff Roche committed Jun 2, 2022
1 parent c633f12 commit a87fcaf
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 4 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,6 @@ vendor/
# Go workspace file
go.work
dist/

# version file
version.txt
2 changes: 2 additions & 0 deletions .goreleaser.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ builds:
goarch:
- amd64
- arm64
ldflags:
- -X "github.com/jeff-roche/biome/main.version={{.Env.VERSION}}"
archives:
- replacements:
darwin: Darwin
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,8 @@ $ onstaging ./bin/ci/deploy-service.sh
```

## Future Plans
- Implement goreleaser for binary building
- Use semantic versioning
- :white_check_mark: Implement goreleaser for binary building
- :white_check_mark: Use semantic versioning
- Add a version command
- Accept all valid yaml file extensions
- Build a Drone CI/CD pipeline
Expand Down
14 changes: 12 additions & 2 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,30 @@ package main

import (
"flag"
"fmt"
"log"
"os"
"os/exec"

"github.com/jeff-roche/biome/parser"
)

var version string

func main() {
vflag := flag.Bool("version", false, "display the release version of this tool")
biomeName := flag.String("b", "", "[Required] The name of the biome to use")

flag.Parse()

cmds := flag.Args()
// If they specified -v, just print the version
if *vflag {
fmt.Println(version)
return
}

// Fetch the command they want to run
cmds := flag.Args()

if len(cmds) < 1 {
log.Fatalln("No command provided")
Expand All @@ -42,4 +52,4 @@ func main() {
if err != nil {
log.Fatal(err)
}
}
}

0 comments on commit a87fcaf

Please sign in to comment.