diff --git a/DEV.md b/DEV.md index 0067ecf..25171b4 100644 --- a/DEV.md +++ b/DEV.md @@ -2,7 +2,7 @@ ## Development -After cloning this repository, set up the pre-commit hook to ensure proper formatting of the Go code: +After cloning this repository, set up the pre-commit hook to ensure proper formatting of the Go code and the `go.mod` and `go.sum` files: ```shell ln -s ../../git-hooks/pre-commit .git/hooks/pre-commit ``` @@ -13,10 +13,11 @@ When developing, you can build a local version of the `gocsv` binary via running To release an update to `gocsv`, make sure you have committed and pushed the most recent commit on master. Then: -1. Tag the latest commit as "latest". +1. Tag the latest commit following [semantic versioning](https://semver.org) and push the tag. ```shell - make tag + git tag -a v1.2.3 -m "Release v1.2.3" + git push origin v1.2.3 ``` @@ -27,6 +28,6 @@ To release an update to `gocsv`, make sure you have committed and pushed the mos make dist ``` - This will create zip files in the `dist` directory holding the `gocsv` binaries for various platforms and architectures. + This will create zip files in the `dist` directory holding the `gocsv` binaries for various platforms and architectures. The version to be returned by `gocsv version` is derived from the Git tag, so make sure to only run this after having carried out step 1. -3. Upload the newly created distribution binaries to the [Latest Release](https://github.com/aotimme/gocsv/releases/tag/latest) page. You will need to [edit](https://github.com/aotimme/gocsv/releases/edit/latest) the release, remove the existing zip files, and upload the recently created zip files in `dist/`. +3. Navigate to the [Releases page](https://github.com/aotimme/gocsv/releases) and draft a new release. Upload the newly created distribution binaries (zip files in `dist/`) by dropping them on the page. diff --git a/Makefile b/Makefile index aa6cb3b..6ca6f58 100644 --- a/Makefile +++ b/Makefile @@ -10,9 +10,6 @@ EXECUTABLE=gocsv dist: bash scripts/build-dist.sh -tag: - bash scripts/update-latest-tag.sh - test: cd $(CMD_DIR) && GO111MODULE=on go test -cover cd $(CSV_DIR) && GO111MODULE=on go test -cover diff --git a/README.md b/README.md index c98c95c..736ac54 100644 --- a/README.md +++ b/README.md @@ -757,7 +757,7 @@ To enable debugging mode when running a `gocsv` command, specify the `--debug` c ## Installation -For the latest pre-built binaries, cross-compiled using [xgo](https://github.com/karalabe/xgo), see the [Latest Release](https://github.com/aotimme/gocsv/releases/tag/latest) page. +For the latest pre-built binaries, cross-compiled using [xgo](https://github.com/karalabe/xgo), see the [Latest Release](https://github.com/aotimme/gocsv/releases/latest) page. ### Apple OS X @@ -766,7 +766,7 @@ For the latest pre-built binaries, cross-compiled using [xgo](https://github.com Open a Terminal window and paste the following command: ```shell -/bin/bash <(curl -s https://raw.githubusercontent.com/aotimme/gocsv/latest/scripts/install-latest-darwin-amd64.sh) +/bin/bash <(curl -s https://raw.githubusercontent.com/aotimme/gocsv/master/scripts/install-latest-darwin-amd64.sh) ``` This will install `gocsv` at `/usr/local/bin/gocsv`. diff --git a/VERSION b/VERSION deleted file mode 100644 index 07650b8..0000000 --- a/VERSION +++ /dev/null @@ -1 +0,0 @@ -x.x.x \ No newline at end of file diff --git a/cmd/add.go b/cmd/add.go index 60aa680..2097a85 100644 --- a/cmd/add.go +++ b/cmd/add.go @@ -3,10 +3,11 @@ package cmd import ( "bytes" "flag" + "html/template" "io" "strconv" - "html/template" - "github.com/Masterminds/sprig" + + "github.com/Masterminds/sprig/v3" ) type AddSubcommand struct { diff --git a/cmd/go.mod b/cmd/go.mod deleted file mode 100644 index 0769cea..0000000 --- a/cmd/go.mod +++ /dev/null @@ -1,22 +0,0 @@ -module github.com/aotimme/gocsv/cmd - -go 1.14 - -replace github.com/aotimme/gocsv/csv => ../csv - -require ( - github.com/Masterminds/goutils v1.1.0 // indirect - github.com/Masterminds/semver v1.5.0 // indirect - github.com/Masterminds/sprig v2.22.0+incompatible - github.com/alphagov/router v0.0.0-20161125164013-5d98b0d9fc19 - github.com/aotimme/gocsv/csv v0.0.0 - github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57 // indirect - github.com/google/uuid v1.1.1 // indirect - github.com/huandu/xstrings v1.3.2 // indirect - github.com/imdario/mergo v0.3.10 // indirect - github.com/mattn/go-sqlite3 v1.10.0 - github.com/mitchellh/copystructure v1.0.0 // indirect - github.com/tealeg/xlsx v0.0.0-20161026161224-a8490cf686de - golang.org/x/arch v0.0.0-20181203225421-5a4828bb7045 // indirect - golang.org/x/crypto v0.0.0-20200728195943-123391ffb6de // indirect -) diff --git a/cmd/go.sum b/cmd/go.sum deleted file mode 100644 index 49b9bd0..0000000 --- a/cmd/go.sum +++ /dev/null @@ -1,37 +0,0 @@ -github.com/Masterminds/goutils v1.1.0 h1:zukEsf/1JZwCMgHiK3GZftabmxiCw4apj3a28RPBiVg= -github.com/Masterminds/goutils v1.1.0/go.mod h1:8cTjp+g8YejhMuvIA5y2vz3BpJxksy863GQaJW2MFNU= -github.com/Masterminds/semver v1.5.0 h1:H65muMkzWKEuNDnfl9d70GUjFniHKHRbFPGBuZ3QEww= -github.com/Masterminds/semver v1.5.0/go.mod h1:MB6lktGJrhw8PrUyiEoblNEGEQ+RzHPF078ddwwvV3Y= -github.com/Masterminds/sprig v2.22.0+incompatible h1:z4yfnGrZ7netVz+0EDJ0Wi+5VZCSYp4Z0m2dk6cEM60= -github.com/Masterminds/sprig v2.22.0+incompatible/go.mod h1:y6hNFY5UBTIWBxnzTeuNhlNS5hqE0NB0E6fgfo2Br3o= -github.com/alphagov/router v0.0.0-20161125164013-5d98b0d9fc19 h1:LX9H/VztLww9xtRK5O1coSCiRkF0UqLZytIMzg8CYUU= -github.com/alphagov/router v0.0.0-20161125164013-5d98b0d9fc19/go.mod h1:Mp21fDX6h4wMwSzsItDP+UtNLAlQOZZIXu6/YsyQae0= -github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57 h1:eqyIo2HjKhKe/mJzTG8n4VqvLXIOEG+SLdDqX7xGtkY= -github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= -github.com/google/uuid v1.1.1 h1:Gkbcsh/GbpXz7lPftLA3P6TYMwjCLYm83jiFQZF/3gY= -github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/huandu/xstrings v1.3.2 h1:L18LIDzqlW6xN2rEkpdV8+oL/IXWJ1APd+vsdYy4Wdw= -github.com/huandu/xstrings v1.3.2/go.mod h1:y5/lhBue+AyNmUVz9RLU9xbLR0o4KIIExikq4ovT0aE= -github.com/imdario/mergo v0.3.10 h1:6q5mVkdH/vYmqngx7kZQTjJ5HRsx+ImorDIEQ+beJgc= -github.com/imdario/mergo v0.3.10/go.mod h1:jmQim1M+e3UYxmgPu/WyfjB3N3VflVyUjjjwH0dnCYA= -github.com/mattn/go-sqlite3 v1.0.1-0.20150807032509-0fa27b5cb05c h1:zs99zFsZn1DKeW4wkNZjFxNC4lWawORDE6IFej7do9A= -github.com/mattn/go-sqlite3 v1.0.1-0.20150807032509-0fa27b5cb05c/go.mod h1:FPy6KqzDD04eiIsT53CuJW3U88zkxoIYsOqkbpncsNc= -github.com/mattn/go-sqlite3 v1.10.0 h1:jbhqpg7tQe4SupckyijYiy0mJJ/pRyHvXf7JdWK860o= -github.com/mattn/go-sqlite3 v1.10.0/go.mod h1:FPy6KqzDD04eiIsT53CuJW3U88zkxoIYsOqkbpncsNc= -github.com/mitchellh/copystructure v1.0.0 h1:Laisrj+bAB6b/yJwB5Bt3ITZhGJdqmxquMKeZ+mmkFQ= -github.com/mitchellh/copystructure v1.0.0/go.mod h1:SNtv71yrdKgLRyLFxmLdkAbkKEFWgYaq1OVrnRcwhnw= -github.com/mitchellh/reflectwalk v1.0.0 h1:9D+8oIskB4VJBN5SFlmc27fSlIBZaov1Wpk/IfikLNY= -github.com/mitchellh/reflectwalk v1.0.0/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx0jmZXqmk4esnw= -github.com/tealeg/xlsx v0.0.0-20161026161224-a8490cf686de h1:PC5Hwqy6Muk6JOroE699iNIxzZLlnls3iEDXbClQsKc= -github.com/tealeg/xlsx v0.0.0-20161026161224-a8490cf686de/go.mod h1:uxu5UY2ovkuRPWKQ8Q7JG0JbSivrISjdPzZQKeo74mA= -golang.org/x/arch v0.0.0-20181203225421-5a4828bb7045 h1:Pn8fQdvx+z1avAi7fdM2kRYWQNxGlavNDSyzrQg2SsU= -golang.org/x/arch v0.0.0-20181203225421-5a4828bb7045/go.mod h1:cYlCBUl1MsqxdiKgmc4uh7TxZfWSFLOGSRR090WDxt8= -golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= -golang.org/x/crypto v0.0.0-20200728195943-123391ffb6de h1:ikNHVSjEfnvz6sxdSPCaPt572qowuyMDMJLLm3Db3ig= -golang.org/x/crypto v0.0.0-20200728195943-123391ffb6de/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= -gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= diff --git a/csv/go.mod b/csv/go.mod deleted file mode 100644 index 94de176..0000000 --- a/csv/go.mod +++ /dev/null @@ -1 +0,0 @@ -module github.com/aotimme/gocsv/csv diff --git a/git-hooks/pre-commit b/git-hooks/pre-commit index 242159f..70ba0ce 100755 --- a/git-hooks/pre-commit +++ b/git-hooks/pre-commit @@ -3,13 +3,22 @@ # Use of this source code is governed by a BSD-style # license that can be found in the LICENSE file. -# git gofmt pre-commit hook +# git gofmt & go mod tidy pre-commit hook # # To use, store as .git/hooks/pre-commit inside your repository and make sure # it has execute permissions. # # This script does not handle file names that contain spaces. +function failWithMessage { + echo >&2 $1 + exit 1 +} + +# Adapted from dnephin/pre-commit-golang +go mod tidy -v 2>&1 | grep -q "updates to go.mod needed" && failWithMessage "go mod tidy: updates to go.mod needed" +git diff --exit-code go.* &> /dev/null || failWithMessage "go.mod or go.sum differs, please re-add it to your commit" + gofiles=$(git diff --cached --name-only --diff-filter=ACM | grep '\.go$') [ -z "$gofiles" ] && exit 0 @@ -17,10 +26,8 @@ unformatted=$(gofmt -l $gofiles) [ -z "$unformatted" ] && exit 0 # Some files are not gofmt'd. Print message and fail. - -echo >&2 "Go files must be formatted with gofmt. Please run:" +msg="Go files must be formatted with gofmt. Please run:" for fn in $unformatted; do - echo >&2 " gofmt -w $PWD/$fn" + msg+="\n gofmt -w $PWD/$fn" done - -exit 1 +failWithMessage msg diff --git a/go.mod b/go.mod index 9e4270c..e50c9b6 100644 --- a/go.mod +++ b/go.mod @@ -2,21 +2,9 @@ module github.com/aotimme/gocsv go 1.14 -replace ( - github.com/aotimme/gocsv/cmd => ./cmd - github.com/aotimme/gocsv/csv => ./csv -) - require ( - github.com/Masterminds/goutils v1.1.0 // indirect - github.com/Masterminds/semver v1.5.0 // indirect - github.com/Masterminds/sprig v2.22.0+incompatible // indirect - github.com/aotimme/gocsv/cmd v0.0.0 - github.com/aotimme/gocsv/csv v0.0.0 - github.com/google/uuid v1.1.1 // indirect - github.com/huandu/xstrings v1.3.2 // indirect - github.com/imdario/mergo v0.3.10 // indirect - github.com/mitchellh/copystructure v1.0.0 // indirect + github.com/Masterminds/sprig/v3 v3.1.0 + github.com/alphagov/router v0.0.0-20161125164013-5d98b0d9fc19 + github.com/mattn/go-sqlite3 v1.10.0 github.com/tealeg/xlsx v1.0.5 - golang.org/x/crypto v0.0.0-20200728195943-123391ffb6de // indirect ) diff --git a/go.sum b/go.sum index af8c0a3..8ad82da 100644 --- a/go.sum +++ b/go.sum @@ -1,41 +1,51 @@ github.com/Masterminds/goutils v1.1.0 h1:zukEsf/1JZwCMgHiK3GZftabmxiCw4apj3a28RPBiVg= github.com/Masterminds/goutils v1.1.0/go.mod h1:8cTjp+g8YejhMuvIA5y2vz3BpJxksy863GQaJW2MFNU= -github.com/Masterminds/semver v1.5.0 h1:H65muMkzWKEuNDnfl9d70GUjFniHKHRbFPGBuZ3QEww= -github.com/Masterminds/semver v1.5.0/go.mod h1:MB6lktGJrhw8PrUyiEoblNEGEQ+RzHPF078ddwwvV3Y= -github.com/Masterminds/sprig v2.22.0+incompatible h1:z4yfnGrZ7netVz+0EDJ0Wi+5VZCSYp4Z0m2dk6cEM60= -github.com/Masterminds/sprig v2.22.0+incompatible/go.mod h1:y6hNFY5UBTIWBxnzTeuNhlNS5hqE0NB0E6fgfo2Br3o= +github.com/Masterminds/semver/v3 v3.1.0 h1:Y2lUDsFKVRSYGojLJ1yLxSXdMmMYTYls0rCvoqmMUQk= +github.com/Masterminds/semver/v3 v3.1.0/go.mod h1:VPu/7SZ7ePZ3QOrcuXROw5FAcLl4a0cBrbBpGY/8hQs= +github.com/Masterminds/sprig/v3 v3.1.0 h1:j7GpgZ7PdFqNsmncycTHsLmVPf5/3wJtlgW9TNDYD9Y= +github.com/Masterminds/sprig/v3 v3.1.0/go.mod h1:ONGMf7UfYGAbMXCZmQLy8x3lCDIPrEZE/rU8pmrbihA= github.com/alphagov/router v0.0.0-20161125164013-5d98b0d9fc19 h1:LX9H/VztLww9xtRK5O1coSCiRkF0UqLZytIMzg8CYUU= github.com/alphagov/router v0.0.0-20161125164013-5d98b0d9fc19/go.mod h1:Mp21fDX6h4wMwSzsItDP+UtNLAlQOZZIXu6/YsyQae0= -github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= +github.com/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8= +github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= +github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/google/uuid v1.1.1 h1:Gkbcsh/GbpXz7lPftLA3P6TYMwjCLYm83jiFQZF/3gY= github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/huandu/xstrings v1.3.2 h1:L18LIDzqlW6xN2rEkpdV8+oL/IXWJ1APd+vsdYy4Wdw= -github.com/huandu/xstrings v1.3.2/go.mod h1:y5/lhBue+AyNmUVz9RLU9xbLR0o4KIIExikq4ovT0aE= -github.com/imdario/mergo v0.3.10 h1:6q5mVkdH/vYmqngx7kZQTjJ5HRsx+ImorDIEQ+beJgc= -github.com/imdario/mergo v0.3.10/go.mod h1:jmQim1M+e3UYxmgPu/WyfjB3N3VflVyUjjjwH0dnCYA= +github.com/huandu/xstrings v1.3.1 h1:4jgBlKK6tLKFvO8u5pmYjG91cqytmDCDvGh7ECVFfFs= +github.com/huandu/xstrings v1.3.1/go.mod h1:y5/lhBue+AyNmUVz9RLU9xbLR0o4KIIExikq4ovT0aE= +github.com/imdario/mergo v0.3.8 h1:CGgOkSJeqMRmt0D9XLWExdT4m4F1vd3FV3VPt+0VxkQ= +github.com/imdario/mergo v0.3.8/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA= +github.com/kr/pretty v0.1.0 h1:L/CwN0zerZDmRFUapSPitk6f+Q3+0za1rQkzVuMiMFI= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= +github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= -github.com/mattn/go-sqlite3 v1.0.1-0.20150807032509-0fa27b5cb05c h1:zs99zFsZn1DKeW4wkNZjFxNC4lWawORDE6IFej7do9A= -github.com/mattn/go-sqlite3 v1.0.1-0.20150807032509-0fa27b5cb05c/go.mod h1:FPy6KqzDD04eiIsT53CuJW3U88zkxoIYsOqkbpncsNc= github.com/mattn/go-sqlite3 v1.10.0 h1:jbhqpg7tQe4SupckyijYiy0mJJ/pRyHvXf7JdWK860o= github.com/mattn/go-sqlite3 v1.10.0/go.mod h1:FPy6KqzDD04eiIsT53CuJW3U88zkxoIYsOqkbpncsNc= github.com/mitchellh/copystructure v1.0.0 h1:Laisrj+bAB6b/yJwB5Bt3ITZhGJdqmxquMKeZ+mmkFQ= github.com/mitchellh/copystructure v1.0.0/go.mod h1:SNtv71yrdKgLRyLFxmLdkAbkKEFWgYaq1OVrnRcwhnw= github.com/mitchellh/reflectwalk v1.0.0 h1:9D+8oIskB4VJBN5SFlmc27fSlIBZaov1Wpk/IfikLNY= github.com/mitchellh/reflectwalk v1.0.0/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx0jmZXqmk4esnw= -github.com/tealeg/xlsx v0.0.0-20161026161224-a8490cf686de h1:PC5Hwqy6Muk6JOroE699iNIxzZLlnls3iEDXbClQsKc= -github.com/tealeg/xlsx v0.0.0-20161026161224-a8490cf686de/go.mod h1:uxu5UY2ovkuRPWKQ8Q7JG0JbSivrISjdPzZQKeo74mA= +github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= +github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/spf13/cast v1.3.1 h1:nFm6S0SMdyzrzcmThSipiEubIDy8WEXKNZ0UOgiRpng= +github.com/spf13/cast v1.3.1/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= +github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= +github.com/stretchr/testify v1.5.1 h1:nOGnQDM7FYENwehXlg/kFVnos3rEvtKTjRvOWSzb6H4= +github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= github.com/tealeg/xlsx v1.0.5 h1:+f8oFmvY8Gw1iUXzPk+kz+4GpbDZPK1FhPiQRd+ypgE= github.com/tealeg/xlsx v1.0.5/go.mod h1:btRS8dz54TDnvKNosuAqxrM1QgN1udgk9O34bDCnORM= -golang.org/x/arch v0.0.0-20181203225421-5a4828bb7045/go.mod h1:cYlCBUl1MsqxdiKgmc4uh7TxZfWSFLOGSRR090WDxt8= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= -golang.org/x/crypto v0.0.0-20200728195943-123391ffb6de h1:ikNHVSjEfnvz6sxdSPCaPt572qowuyMDMJLLm3Db3ig= -golang.org/x/crypto v0.0.0-20200728195943-123391ffb6de/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/crypto v0.0.0-20200414173820-0848c9571904 h1:bXoxMPcSLOq08zI3/c5dEBT6lE4eh+jOh886GHrn6V8= +golang.org/x/crypto v0.0.0-20200414173820-0848c9571904/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= \ No newline at end of file +gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 h1:YR8cESwS4TdDjEe65xsg0ogRM/Nc3DYOhEAlW+xobZo= +gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/yaml.v2 v2.2.2 h1:ZCJp+EgiOT7lHqUV2J862kp8Qj64Jo6az82+3Td9dZw= +gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= diff --git a/scripts/build-bin.sh b/scripts/build-bin.sh index fe5c63c..4cc0d3a 100644 --- a/scripts/build-bin.sh +++ b/scripts/build-bin.sh @@ -4,7 +4,7 @@ BIN_DIR=$(pwd)/bin EXECUTABLE=gocsv GIT_HASH=$(git rev-parse HEAD) -VERSION=$(cat VERSION) +VERSION=$(git describe --tags HEAD) LD_FLAGS="-X github.com/aotimme/gocsv/cmd.VERSION=${VERSION} -X github.com/aotimme/gocsv/cmd.GIT_HASH=${GIT_HASH}" rm -rf ${BIN_DIR} diff --git a/scripts/build-dist.sh b/scripts/build-dist.sh index 0233be4..022925d 100644 --- a/scripts/build-dist.sh +++ b/scripts/build-dist.sh @@ -5,7 +5,7 @@ DIST_DIR=$(pwd)/dist EXECUTABLE=gocsv GIT_HASH=$(git rev-parse HEAD) -VERSION=$(cat VERSION) +VERSION=$(git describe --tags HEAD) LD_FLAGS="-X github.com/aotimme/gocsv/cmd.VERSION=${VERSION} -X github.com/aotimme/gocsv/cmd.GIT_HASH=${GIT_HASH}" rm -rf ${BUILD_DIR} diff --git a/scripts/install-latest-darwin-amd64.sh b/scripts/install-latest-darwin-amd64.sh index feea00a..639802e 100755 --- a/scripts/install-latest-darwin-amd64.sh +++ b/scripts/install-latest-darwin-amd64.sh @@ -2,7 +2,7 @@ BINARY_DIRNAME="gocsv-darwin-10.6-amd64" ZIP_FILENAME="${BINARY_DIRNAME}.zip" -ZIP_URL="https://github.com/aotimme/gocsv/releases/download/latest/${ZIP_FILENAME}" +ZIP_URL="https://github.com/aotimme/gocsv/releases/latest/download/${ZIP_FILENAME}" TMP_DIR=$(mktemp -d) INSTALL_DIR="/usr/local/bin" INSTALL_LOCATION="${INSTALL_DIR}/gocsv" diff --git a/scripts/update-latest-tag.sh b/scripts/update-latest-tag.sh deleted file mode 100644 index a5ffe1e..0000000 --- a/scripts/update-latest-tag.sh +++ /dev/null @@ -1,5 +0,0 @@ -#!/usr/bin/env bash - -git tag -d latest -git tag -a latest -m "Latest" -git push --force origin --tags