Skip to content

Commit

Permalink
chore: Move main.go to root (#285)
Browse files Browse the repository at this point in the history
Signed-off-by: Valentin Kiselev <mrexox@evilmartians.com>
  • Loading branch information
mrexox authored Jun 24, 2022
1 parent 0572a21 commit 5560718
Show file tree
Hide file tree
Showing 11 changed files with 16 additions and 10 deletions.
1 change: 0 additions & 1 deletion .goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ before:
builds:
- env:
- CGO_ENABLED=0
main: ./cmd/lefthook/
goos:
- linux
- darwin
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
build:
go build -o lefthook cmd/lefthook/*.go
go build -o lefthook

test:
go test -cpu 24 -race -count=1 -timeout=30s ./...
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion cmd/lefthook/add.go → cmd/add.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package main
package cmd

import (
_ "embed"
Expand Down
2 changes: 1 addition & 1 deletion cmd/lefthook/install.go → cmd/install.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package main
package cmd

import (
"github.com/spf13/cobra"
Expand Down
4 changes: 2 additions & 2 deletions cmd/lefthook/main.go → cmd/lefthook.go
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
package main
package cmd

import (
"os"

"github.com/evilmartians/lefthook/internal/log"
)

func main() {
func Lefthook() {
rootCmd := newRootCmd()

if err := rootCmd.Execute(); err != nil {
Expand Down
2 changes: 1 addition & 1 deletion cmd/lefthook/root.go → cmd/root.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package main
package cmd

import (
"github.com/MakeNowJust/heredoc"
Expand Down
2 changes: 1 addition & 1 deletion cmd/lefthook/run.go → cmd/run.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package main
package cmd

import (
"github.com/spf13/cobra"
Expand Down
2 changes: 1 addition & 1 deletion cmd/lefthook/uninstall.go → cmd/uninstall.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package main
package cmd

import (
"github.com/spf13/cobra"
Expand Down
2 changes: 1 addition & 1 deletion cmd/lefthook/version.go → cmd/version.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package main
package cmd

import (
"github.com/spf13/cobra"
Expand Down
7 changes: 7 additions & 0 deletions main.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
package main

import "github.com/evilmartians/lefthook/cmd"

func main() {
cmd.Lefthook()
}

0 comments on commit 5560718

Please sign in to comment.