Skip to content

Commit

Permalink
Fix #14
Browse files Browse the repository at this point in the history
  • Loading branch information
raphaelreyna committed Aug 20, 2020
1 parent db2aba8 commit 48e3b99
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 9 deletions.
4 changes: 2 additions & 2 deletions .goreleaser.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ builds:
main: main.go
binary: oneshot
ldflags:
- -X github.com/raphaelreyna/oneshot/cmd/cmd.version={{.Version}}
- -X github.com/raphaelreyna/oneshot/cmd.version={{.Version}}
- -X github.com/raphaelreyna/oneshot/cmd.date={{.Date}}
goos:
- darwin
Expand All @@ -35,7 +35,7 @@ builds:
main: main.go
binary: oneshot
ldflags:
- -X github.com/raphaelreyna/oneshot/cmd/cmd.version={{.Version}}
- -X github.com/raphaelreyna/oneshot/cmd.version={{.Version}}
- -X github.com/raphaelreyna/oneshot/cmd.date={{.Date}}
goos:
- windows
Expand Down
13 changes: 12 additions & 1 deletion cmd/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ import (
"syscall"
)

var version string
var date string

type App struct {
hostname string
ips []string
Expand Down Expand Up @@ -87,10 +90,18 @@ Directories will automatically be archived before being sent (see -a, --archive-
return app, nil
}

func (a *App) SetFlags() {
a.conf.SetFlags(a.cmd)
}

func (a *App) Cmd() *cobra.Command {
return a.cmd
}

func (a *App) Start() {
cobra.MousetrapHelpText = ""

a.conf.SetFlags(a.cmd)
a.SetFlags()

if err := a.cmd.Execute(); err != nil {
log.Println(err)
Expand Down
3 changes: 0 additions & 3 deletions cmd/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,6 @@ import (
"strings"
)

var version string
var date string

const stdinBufferSize = 1024

func (a *App) Run(cmd *cobra.Command, args []string) {
Expand Down
3 changes: 0 additions & 3 deletions release
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,6 @@ NEW_VERSION=""
# Create README.md
rm README.md
make README.md
## Add banner image to top of README.md
sed -i '1i <img src="https://github.com/raphaelreyna/oneshot/raw/master/oneshot_banner.png" width="744px" height="384px">\
' README.md
git add README.md


Expand Down

0 comments on commit 48e3b99

Please sign in to comment.