Skip to content

Commit

Permalink
move main() for dep binary to cmd/baur, cobra cmds to command/
Browse files Browse the repository at this point in the history
Move the main.go to cmd/baur/, the cobra commands to command/
advantages:

- we can have multiple binaries in cmd/
- we can put domain types in the root
  • Loading branch information
fho committed Apr 23, 2018
1 parent 6a87fab commit 48d44fe
Show file tree
Hide file tree
Showing 10 changed files with 18 additions and 16 deletions.
2 changes: 1 addition & 1 deletion .gitignore
@@ -1,5 +1,5 @@
# Binaries for programs and plugins
baur
/baur
dist/**
*.exe
*.dll
Expand Down
4 changes: 2 additions & 2 deletions Makefile
Expand Up @@ -12,9 +12,9 @@ default: all
all: baur

.PHONY: baur
baur:
baur: cmd/baur/main.go
$(info * building $@)
@CGO_ENABLED=0 go build -ldflags=$(LDFLAGS) -o "$@"
@CGO_ENABLED=0 go build -ldflags=$(LDFLAGS) -o "$@" $<

.PHONY: dist/darwin_amd64/baur
dist/darwin_amd64/baur:
Expand Down
9 changes: 9 additions & 0 deletions cmd/baur/main.go
@@ -0,0 +1,9 @@
package main

import (
"github.com/simplesurance/baur/command"
)

func main() {
command.Execute()
}
2 changes: 1 addition & 1 deletion cmd/appinit.go → command/appinit.go
@@ -1,4 +1,4 @@
package cmd
package command

import (
"os"
Expand Down
2 changes: 1 addition & 1 deletion cmd/build.go → command/build.go
@@ -1,4 +1,4 @@
package cmd
package command

import (
"github.com/simplesurance/baur/sblog"
Expand Down
2 changes: 1 addition & 1 deletion cmd/ctx.go → command/ctx.go
@@ -1,4 +1,4 @@
package cmd
package command

import (
"os"
Expand Down
2 changes: 1 addition & 1 deletion cmd/init.go → command/init.go
@@ -1,4 +1,4 @@
package cmd
package command

import (
"os"
Expand Down
2 changes: 1 addition & 1 deletion cmd/ls.go → command/ls.go
@@ -1,4 +1,4 @@
package cmd
package command

import (
"fmt"
Expand Down
2 changes: 1 addition & 1 deletion cmd/root.go → command/root.go
@@ -1,4 +1,4 @@
package cmd
package command

import (
"github.com/simplesurance/baur/sblog"
Expand Down
7 changes: 0 additions & 7 deletions main.go

This file was deleted.

0 comments on commit 48d44fe

Please sign in to comment.