Skip to content

Commit

Permalink
feat: add some config file
Browse files Browse the repository at this point in the history
  • Loading branch information
jonyhy96 committed Oct 16, 2019
1 parent cba9ec7 commit 9578408
Show file tree
Hide file tree
Showing 6 changed files with 188 additions and 0 deletions.
17 changes: 17 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Binaries for programs and plugins
*.exe
*.exe~
*.dll
*.so
*.dylib

# Test binary, build with `go test -c`
*.test

# Output of the go coverage tool, specifically when used with LiteIDE
*.out

sk-job
.vscode
.idea
lastupdate.tmp
54 changes: 54 additions & 0 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
# This is an example goreleaser.yaml file with some sane defaults.
# Make sure to check the documentation at http://goreleaser.com
before:
hooks:
# you may remove this if you don't use vgo
# - go mod download
builds:
- env:
- CGO_ENABLED=0
- id: binary
goos:
- windows
- darwin
- linux
goarch:
- amd64
- arm
- arm64
- 386
goarm:
- 6
- 7
ldflags:
- -a -s -w -X main.version={{.Version}} -X main.commit={{.Commit}} -X main.date={{.Date}} -X main.buildSource=binaryRelease
- id: snap
goos:
- linux
goarch:
- amd64
- arm
- arm64
- 386
goarm:
- 6
- 7
ldflags:
- -a -s -w -X main.version={{.Version}} -X main.commit={{.Commit}} -X main.date={{.Date}} -X main.buildSource=snap
archives:
- builds:
- binary
replacements:
linux: Linux
windows: Windows
format_overrides:
- goos: windows
format: zip
checksum:
name_template: 'checksums.txt'
changelog:
sort: asc
filters:
exclude:
- '^docs:'
- '^test:'
8 changes: 8 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
- repo: git://github.com/dnephin/pre-commit-golang
sha: master
hooks:
- id: go-fmt
exclude: 'vendor'
- id: go-vet
- id: go-lint
exclude: 'vendor'
21 changes: 21 additions & 0 deletions License
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2019 jonyhy96

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
27 changes: 27 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#! /usr/bin/make -f

.PHONY: all
all: package

.PHONY: test
test:
go test -tags=unit -timeout 30s -short -v `go list ./... | grep -v /vendor/`

.PHONY: init
init:
pre-commit install

.PHONY: package
package: clean build release

.PHONY: build
build:
CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -o replacer .

.PHONY: release
release:
goreleaser

.PHONY: clean
clean:
rm -f dist;
61 changes: 61 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
# replacer
[![Go Report Card](https://goreportcard.com/badge/github.com/jonyhy96/replacer)](https://goreportcard.com/report/github.com/jonyhy96/replacer)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)

replacer helps you to batch replace files

## Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes.

```
$ go get github.com/jonyhy96/replacer
$ replacer -h
$ replacer -f ./keys.json -w .
```

### Prerequisites

For develop

- go ^1.10

### Installing

```
$ go build -o replacer .
$ sudo mv replacer /usr/local/bin
```

### Params

| param | required | e.g. |
| :--------: | :-----: | :----: |
| f | true | -f ./keys.json |
| w | true | -w . |

### Coding style

[CODEFMT](https://github.com/golang/go/wiki/CodeReviewComments)

## Contributing

Please read [CONTRIBUTING.md](CONTRIBUTING.md) for details on our code of conduct, and the process for submitting pull requests to us.

## Versioning

We use [SemVer](http://semver.org/) for versioning. For the versions available, see the [tags on this repository](https://gitlab.domain.com/golang/containerM/tags).

## Authors

* **HAO YUN** - *Initial work* - [haoyun](https://github.com/jonyhy96)

See also the list of [contributors](CONTRIBUTORS.md) who participated in this project.

## License

This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details

## Acknowledgments

* nothing

0 comments on commit 9578408

Please sign in to comment.