Skip to content

Commit b5d85c1

Browse files
committed
rename versionDate variable to buildDate in all resto
1 parent e7b1467 commit b5d85c1

File tree

8 files changed

+11
-11
lines changed

8 files changed

+11
-11
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ jobs:
2626
run: |
2727
go mod tidy
2828
go run ./build/date.go >> date.txt
29-
go build -ldflags "-X main.version=$(git describe --abbrev=0 --tags) -X main.versionDate=$(cat date.txt)" -o resto
29+
go build -ldflags "-X main.version=$(git describe --abbrev=0 --tags) -X main.buildDate=$(cat date.txt)" -o resto
3030
3131
- name: Run `Restofile`
3232
run: |

.github/workflows/go.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ jobs:
2020
- name: Build
2121
run: |
2222
go run ./build/date.go >> date.txt
23-
go build -ldflags "-X main.version=$(git describe --abbrev=0 --tags) -X main.versionDate=$(cat date.txt)" -o resto
23+
go build -ldflags "-X main.version=$(git describe --abbrev=0 --tags) -X main.buildDate=$(cat date.txt)" -o resto
2424
2525
- name: Test
2626
run: go test -v ./...

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ jobs:
4040
run: go run ./build/date.go >> date.txt
4141

4242
- name: Build
43-
run: VersionDate="$(cat date.txt)" goreleaser release --rm-dist --timeout 100m
43+
run: BuildDate="$(cat date.txt)" goreleaser release --rm-dist --timeout 100m
4444

4545
- name: Setup `Node.js`
4646
uses: actions/setup-node@v2.5.0

.goreleaser.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ builds:
1818
main: ./
1919
ldflags:
2020
- -X main.version=v{{ .Version }}
21-
- -X main.versionDate={{ .Env.VersionDate }}
21+
- -X main.buildDate={{ .Env.BuildDate }}
2222

2323
id: macos
2424
goos: [ darwin ]

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ DATE=$(shell go run ./build/date.go)
55

66
build:
77
@go mod tidy && \
8-
go build -ldflags "-X main.version=$(TAG) -X main.versionDate=$(DATE)" -o resto
8+
go build -ldflags "-X main.version=$(TAG) -X main.buildDate=$(DATE)" -o resto
99

1010
install: resto
1111
@mv resto /usr/local/bin

cmd/resto/root.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import (
1515
)
1616

1717
// Execute start the CLI
18-
func Execute(f *factory.Factory, version string, versionDate string) *cobra.Command {
18+
func Execute(f *factory.Factory, version string, buildDate string) *cobra.Command {
1919
tools.CheckDotResto()
2020

2121
const desc = `a CLI app can send pretty HTTP & API requests with TUI.`
@@ -67,7 +67,7 @@ func Execute(f *factory.Factory, version string, versionDate string) *cobra.Comm
6767
Aliases: []string{"ver"},
6868
Short: "Print the version of your resto binary.",
6969
Run: func(cmd *cobra.Command, args []string) {
70-
fmt.Println("resto version " + version + " " + versionDate)
70+
fmt.Println("resto version " + version + " " + buildDate)
7171
},
7272
}
7373

main.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ import (
1919

2020
var (
2121
version string
22-
versionDate string
22+
buildDate string
2323
)
2424

2525
type exitCode int
@@ -64,7 +64,7 @@ func mainRun() exitCode {
6464
cobra.MousetrapHelpText = ""
6565
}
6666

67-
RootCmd := resto.Execute(cmdFactory, version, versionDate)
67+
RootCmd := resto.Execute(cmdFactory, version, buildDate)
6868

6969
if cmd, err := RootCmd.ExecuteC(); err != nil {
7070
if err == tools.SilentError {

scripts/gh-resto/templates/gh-resto

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ set -e
33

44
repo="abdfnx/gh-resto"
55
tag="CLI_VERSION"
6-
versionDate="CLI_VERSION_DATE"
6+
buildDate="CLI_VERSION_DATE"
77

88
extensionPath="$(dirname "$0")"
99
arch="$(uname -m)"
@@ -41,7 +41,7 @@ if [ "${exe}" == "" ]; then
4141
exe="cmd.out"
4242

4343
cd "${extensionPath}" > /dev/null
44-
go build -o "${exe}" -ldflags "-X main.version=${tag} -X main.versionDate=${versionDate}"
44+
go build -o "${exe}" -ldflags "-X main.version=${tag} -X main.buildDate=${buildDate}"
4545
cd - > /dev/null
4646
else
4747
if [[ ! -x "${extensionPath}/bin/${exe}" ]]; then

0 commit comments

Comments
 (0)