Selaa lähdekoodia

add goreleaser package

tags/v1.1.0
ojizero 5 kuukautta sitten
vanhempi
commit
5f98ec040a
3 muutettua tiedostoa jossa 52 lisäystä ja 0 poistoa
  1. 3
    0
      .gitignore
  2. 35
    0
      .goreleaser.yml
  3. 14
    0
      cmd/main.go

+ 3
- 0
.gitignore Näytä tiedosto

@@ -22,4 +22,7 @@
/vendor/
/Godeps/

### GoReleaser ###
dist

# End of https://www.gitignore.io/api/go

+ 35
- 0
.goreleaser.yml Näytä tiedosto

@@ -0,0 +1,35 @@
before:
hooks:
- go mod download

builds:
- env:
- CGO_ENABLED=0
main: ./cmd/main.go
goos:
- linux
- darwin
- windows
goarch:
- amd64

checksum:
name_template: 'checksums.txt'

snapshot:
name_template: "{{ .Tag }}-next"

changelog:
sort: asc
filters:
exclude:
- '^docs:'
- '^test:'

brews:
- github:
owner: ojizero
name: homebrew-tap
folder: Formula
homepage: https://github.com/ojizer/gofindup
description: Simple find up utility

+ 14
- 0
cmd/main.go Näytä tiedosto

@@ -2,22 +2,36 @@ package main

import (
"fmt"
"os"

flag "github.com/spf13/pflag"

"github.com/ojizero/gofindup"
)

var (
version = "dev"
commit = "HEAD"
date = "unknown"
)

func main() {
var (
startdir string
nametofind string
printversion bool
)

flag.BoolVarP(&printversion, "version", "v", false, "Display version info and exit program")
flag.StringVarP(&startdir, "startdir", "s", "", "Directory to start searching from, if not given would search from current working directory")
flag.Parse()
nametofind = flag.Arg(0)

if printversion {
fmt.Printf("Version: %v, Build commit: %v, Released on: %v\n", version, commit, date)
os.Exit(0)
}

findup := gofindup.Findup
if startdir != "" {
findup = func(name string) (string, error) {

Loading…
Peruuta
Tallenna