Skip to content

Commit

Permalink
moved main to cmd sub directory
Browse files Browse the repository at this point in the history
  • Loading branch information
katbyte committed May 24, 2019
1 parent 12a4ac6 commit fa8004b
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 7 deletions.
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
tctest
.DS_Store
.idea/
2 changes: 1 addition & 1 deletion cmd/cmds.go → cmd/tctest/cli/cmds.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package cmd
package cli

import (
"fmt"
Expand Down
2 changes: 1 addition & 1 deletion cmd/pr.go → cmd/tctest/cli/pr.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package cmd
package cli

import (
"bufio"
Expand Down
2 changes: 1 addition & 1 deletion cmd/tc.go → cmd/tctest/cli/tc.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package cmd
package cli

import (
"encoding/xml"
Expand Down
4 changes: 2 additions & 2 deletions main.go → cmd/tctest/tctest.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@ import (
"os"

c "github.com/gookit/color"
"github.com/katbyte/tctest/cmd"
"github.com/katbyte/tctest/cmd/tctest/cli"
"github.com/katbyte/tctest/common"
)

func main() {
if err := cmd.Make().Execute(); err != nil {
if err := cli.Make().Execute(); err != nil {
common.Log.Errorf(c.Sprintf("<red>tctest:</> %v", err))
os.Exit(1)
}
Expand Down
6 changes: 5 additions & 1 deletion makefile
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ imports:

build:
@echo "==> building..."
go build -ldflags "-X github.com/katbyte/tctest/version.GitCommit=${GIT_COMMIT}" .
cd cmd/tctest && go build -ldflags "-X github.com/katbyte/tctest/version.GitCommit=${GIT_COMMIT}" . && mv tctest ../../

install:
@echo "==> installing..."
cd cmd/tctest && go install -ldflags "-X github.com/katbyte/tctest/version.GitCommit=${GIT_COMMIT}" .

.PHONY: fmt imports build

0 comments on commit fa8004b

Please sign in to comment.