Skip to content
This repository has been archived by the owner on Mar 27, 2024. It is now read-only.

Commit

Permalink
Setup GoReleaser and versioning.
Browse files Browse the repository at this point in the history
  • Loading branch information
ziadoz committed Aug 26, 2018
1 parent 21fee24 commit dba9fa2
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 2 deletions.
21 changes: 21 additions & 0 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
builds:
- env:
- CGO_ENABLED=0
main: ./bin/main.go
archive:
replacements:
darwin: Darwin
linux: Linux
windows: Windows
386: i386
amd64: x86_64
checksum:
name_template: 'checksums.txt'
snapshot:
name_template: "{{ .Tag }}-next"
changelog:
sort: asc
filters:
exclude:
- '^docs:'
- '^test:'
19 changes: 17 additions & 2 deletions bin/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,21 +15,36 @@ import (

const workers int = 4

var bin pathflag.Path
var src pathflag.Path
var (
version = "dev"
commit = "none"
date = "unknown"
)

var (
ver bool
bin pathflag.Path
src pathflag.Path
)

type result struct {
cmd *swap.Cmd
err error
}

func init() {
flag.BoolVar(&ver, "version", false, "The version of media swapper")
flag.Var(&bin, "bin", "The location of the ffmpeg or avconv binary")
flag.Var(&src, "src", "The source directory of mkv/m4a files or an individual mkv/m4a file to swap to mp4/mp3")
flag.Parse()
}

func main() {
if ver {
fmt.Printf("Version: %s\nCommit: %s\nDate: %s\n", version, commit, date)
os.Exit(0)
}

if bin.Path == "" {
fmt.Fprintln(os.Stderr, "The -bin flag must be specified")
os.Exit(1)
Expand Down

0 comments on commit dba9fa2

Please sign in to comment.