Skip to content

Commit ddb3501

Browse files
committed
tools: move binaries to ".bin"
1 parent 9565fe5 commit ddb3501

File tree

3 files changed

+12
-10
lines changed

3 files changed

+12
-10
lines changed

.github/workflows/main.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@ jobs:
1717
env:
1818
MAGEFILE_VERBOSE: true
1919
run: |
20-
GOBIN="$(pwd)/bin" go install github.com/magefile/mage
21-
./bin/mage install
22-
./bin/mage lint
20+
GOBIN="$(pwd)/.bin" go install github.com/magefile/mage
21+
./.bin/mage install
22+
./.bin/mage lint
2323
2424
test:
2525
needs: lint
@@ -40,5 +40,5 @@ jobs:
4040
MAGEFILE_VERBOSE: true
4141
shell: bash
4242
run: |
43-
GOBIN="$(pwd)/bin" go install github.com/magefile/mage
44-
./bin/mage test
43+
GOBIN="$(pwd)/.bin" go install github.com/magefile/mage
44+
./.bin/mage test

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
tags
22
*.out
3-
bin/
3+
.bin/

magefile.go

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ const (
1616
goplsImportPath = "golang.org/x/tools/gopls"
1717
goimportsImportPath = "golang.org/x/tools/cmd/goimports"
1818
golintImportPath = "golang.org/x/lint/golint"
19+
20+
bin = ".bin"
1921
)
2022

2123
var (
@@ -38,7 +40,7 @@ func Fix() error {
3840
return err
3941
}
4042

41-
goimportsCmd := filepath.Join(root, "bin", "goimports")
43+
goimportsCmd := filepath.Join(root, bin, "goimports")
4244
return sh.Run(goimportsCmd, "-w", root)
4345
}
4446

@@ -53,7 +55,7 @@ func Install() error {
5355
goimportsImportPath,
5456
golintImportPath,
5557
}
56-
gobin := filepath.Join(root, "bin")
58+
gobin := filepath.Join(root, bin)
5759
for _, dep := range deps {
5860
if err := sh.RunWith(
5961
map[string]string{"GOBIN": gobin},
@@ -71,15 +73,15 @@ func Lint() error {
7173
if err != nil {
7274
return err
7375
}
74-
goimportsCmd := filepath.Join(root, "bin", "goimports")
76+
goimportsCmd := filepath.Join(root, bin, "goimports")
7577
goimportsDiff, err := sh.Output(goimportsCmd, "-d", root)
7678
if err != nil {
7779
return err
7880
}
7981
if goimportsDiff != "" {
8082
return fmt.Errorf("\n%s", goimportsDiff)
8183
}
82-
golintCmd := filepath.Join(root, "bin", "golint")
84+
golintCmd := filepath.Join(root, bin, "golint")
8385
return sh.Run(golintCmd, "-set_exit_status", filepath.Join(root, "..."))
8486
}
8587

0 commit comments

Comments
 (0)