From eb6a7e71c32c4e6443ac5234a14c77bbcd83b753 Mon Sep 17 00:00:00 2001 From: Finn Date: Mon, 8 Oct 2018 18:03:28 -0700 Subject: [PATCH] Move cmd to ./cmd/signald-cli cobra is trying to encourage an annoying file layout --- .gitignore | 2 +- .gitlab-ci.yml | 3 +-- {signald-cli => cmd/signald-cli}/cmd/root.go | 0 {signald-cli => cmd/signald-cli}/cmd/send.go | 0 cmd/signald-cli/main.go | 7 +++++++ signald-cli/main.go | 7 ------- 6 files changed, 9 insertions(+), 10 deletions(-) rename {signald-cli => cmd/signald-cli}/cmd/root.go (100%) rename {signald-cli => cmd/signald-cli}/cmd/send.go (100%) create mode 100644 cmd/signald-cli/main.go delete mode 100644 signald-cli/main.go diff --git a/.gitignore b/.gitignore index cb6b6d2..35ec54d 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,4 @@ -signald-cli/signald-cli +/signald-cli # Binaries for programs and plugins *.exe diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 20429d1..c8b2dae 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -21,8 +21,7 @@ build: - cd /go/src/git.callpipe.com/finn/signald-go script: - go get ./... # TODO: Improve how dependencies are handled - - cd signald-cli - - go build -o "${CI_PROJECT_DIR}/signald-cli" . + - go build -o "${CI_PROJECT_DIR}/signald-cli" ./cmd/signald-cli artifacts: paths: - signald-cli diff --git a/signald-cli/cmd/root.go b/cmd/signald-cli/cmd/root.go similarity index 100% rename from signald-cli/cmd/root.go rename to cmd/signald-cli/cmd/root.go diff --git a/signald-cli/cmd/send.go b/cmd/signald-cli/cmd/send.go similarity index 100% rename from signald-cli/cmd/send.go rename to cmd/signald-cli/cmd/send.go diff --git a/cmd/signald-cli/main.go b/cmd/signald-cli/main.go new file mode 100644 index 0000000..423dbb2 --- /dev/null +++ b/cmd/signald-cli/main.go @@ -0,0 +1,7 @@ +package main + +import "git.callpipe.com/finn/signald-go/cmd/signald-cli/cmd" + +func main() { + cmd.Execute() +} diff --git a/signald-cli/main.go b/signald-cli/main.go deleted file mode 100644 index 20b494d..0000000 --- a/signald-cli/main.go +++ /dev/null @@ -1,7 +0,0 @@ -package main - -import "git.callpipe.com/finn/signald-go/signald-cli/cmd" - -func main() { - cmd.Execute() -}