Skip to content

Commit

Permalink
Merge pull request #257 from ajnavarro/fix/makefile-cmd-to-cli-path
Browse files Browse the repository at this point in the history
Fix wrong commands path on Makefile
  • Loading branch information
ajnavarro authored May 8, 2018
2 parents 8b8da0b + c0a3abb commit ee3bf19
Show file tree
Hide file tree
Showing 5 changed files with 40 additions and 40 deletions.
4 changes: 1 addition & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,7 @@ _testmain.go
*.exe
*.test
*.prof
gitbase

# CI
.ci/
gitbase
gitbase.exe
build/
35 changes: 0 additions & 35 deletions cli/gitbase/main.go

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package cmd
package command

import (
"net"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package cmd
package command

import "fmt"

Expand Down
37 changes: 37 additions & 0 deletions cmd/gitbase/main.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
package main

import (
"os"

"github.com/src-d/gitbase/cmd/gitbase/command"

"github.com/jessevdk/go-flags"
)

const (
name = "gitbase"
)

func main() {
parser := flags.NewNamedParser(name, flags.Default)

parser.AddCommand("server", command.ServerDescription, command.ServerHelp,
&command.Server{
UnstableSquash: os.Getenv("GITBASE_UNSTABLE_SQUASH_ENABLE") != "",
SkipGitErrors: os.Getenv("GITBASE_SKIP_GIT_ERRORS") != "",
})

parser.AddCommand("version", command.VersionDescription, command.VersionHelp,
&command.Version{
Name: name,
})

_, err := parser.Parse()
if err != nil {
if e, ok := err.(*flags.Error); ok && e.Type == flags.ErrCommandRequired {
parser.WriteHelp(os.Stdout)
}

os.Exit(1)
}
}

0 comments on commit ee3bf19

Please sign in to comment.