Skip to content

Commit

Permalink
Fix duplicate
Browse files Browse the repository at this point in the history
  • Loading branch information
sgreben committed Oct 8, 2018
1 parent 3b6ca29 commit a9010f8
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 14 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
APP=gif
NAME := yeetgif
REPOSITORY := quay.io/sergey_grebenshchikov/$(NAME)
VERSION := 1.11.2
VERSION := 1.11.3
VERSION_COMMIT := $(VERSION)-$(shell printf "%s" "$$(git rev-parse HEAD)" | cut -c 1-8)

PACKAGES := $(shell go list -f {{.Dir}} ./...)
Expand Down
22 changes: 9 additions & 13 deletions cmd/gif/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,16 @@ var (

func main() {
app.Before = func() {
ProcessGlobalFlags()
images = Input(os.Stdin)
config.Duplicate = *duplicate
config.Quiet = *quiet
config.Pad = *pad
config.DelayMilliseconds = *delay
config.WriteMeta = *writeMeta
if config.Quiet {
log.SetOutput(ioutil.Discard)
}
CommandDuplicate(config.Duplicate)
}
app.Run(os.Args)
if !config.NoOutput {
Expand Down Expand Up @@ -108,18 +116,6 @@ func init() {
app.Command(commandMeta, "(🧠 ͡ಠ ʖ̯ ͡ಠ)┌", CommandMeta)
}

func ProcessGlobalFlags() {
config.Duplicate = *duplicate
config.Quiet = *quiet
config.Pad = *pad
config.DelayMilliseconds = *delay
config.WriteMeta = *writeMeta
if config.Quiet {
log.SetOutput(ioutil.Discard)
}
CommandDuplicate(config.Duplicate)
}

func Input(r io.Reader) []image.Image {
images := Decode(os.Stdin)
if len(images) == 0 {
Expand Down

0 comments on commit a9010f8

Please sign in to comment.