-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
188 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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:' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |