Skip to content

Commit c0a3abb

Browse files
committed
Fix wrong commands path on Makefile
Signed-off-by: Antonio Jesus Navarro Perez <[email protected]>
1 parent f3f8432 commit c0a3abb

File tree

5 files changed

+40
-40
lines changed

5 files changed

+40
-40
lines changed

.gitignore

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,7 @@ _testmain.go
2222
*.exe
2323
*.test
2424
*.prof
25-
gitbase
2625

2726
# CI
2827
.ci/
29-
gitbase
30-
gitbase.exe
28+
build/

cli/gitbase/main.go

Lines changed: 0 additions & 35 deletions
This file was deleted.

cli/gitbase/cmd/server.go renamed to cmd/gitbase/command/server.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package cmd
1+
package command
22

33
import (
44
"net"

cli/gitbase/cmd/version.go renamed to cmd/gitbase/command/version.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package cmd
1+
package command
22

33
import "fmt"
44

cmd/gitbase/main.go

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
package main
2+
3+
import (
4+
"os"
5+
6+
"github.com/src-d/gitbase/cmd/gitbase/command"
7+
8+
"github.com/jessevdk/go-flags"
9+
)
10+
11+
const (
12+
name = "gitbase"
13+
)
14+
15+
func main() {
16+
parser := flags.NewNamedParser(name, flags.Default)
17+
18+
parser.AddCommand("server", command.ServerDescription, command.ServerHelp,
19+
&command.Server{
20+
UnstableSquash: os.Getenv("GITBASE_UNSTABLE_SQUASH_ENABLE") != "",
21+
SkipGitErrors: os.Getenv("GITBASE_SKIP_GIT_ERRORS") != "",
22+
})
23+
24+
parser.AddCommand("version", command.VersionDescription, command.VersionHelp,
25+
&command.Version{
26+
Name: name,
27+
})
28+
29+
_, err := parser.Parse()
30+
if err != nil {
31+
if e, ok := err.(*flags.Error); ok && e.Type == flags.ErrCommandRequired {
32+
parser.WriteHelp(os.Stdout)
33+
}
34+
35+
os.Exit(1)
36+
}
37+
}

0 commit comments

Comments
 (0)