From 40f0436e6ac1e5665b92f8738ab7b00089c42a9c Mon Sep 17 00:00:00 2001 From: mpl Date: Tue, 17 Sep 2019 23:50:24 +0200 Subject: [PATCH] Be more verbose --- main.go | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/main.go b/main.go index 53a626f..d07a7c2 100644 --- a/main.go +++ b/main.go @@ -295,12 +295,18 @@ func (s Session) firstNav(ctx context.Context) error { return nil } -// doRun executes the given filePath as a command +// doRun runs *runFlag as a command on the given filePath. func doRun(filePath string) error { if *runFlag == "" { return nil } - return exec.Command(*runFlag, filePath).Run() + if *verboseFlag { + log.Printf("Running %v on %v", *runFlag, filePath) + } + cmd := exec.Command(*runFlag, filePath) + cmd.Stdout = os.Stdout + cmd.Stderr = os.Stderr + return cmd.Run() } // navLeft navigates to the next item to the left @@ -373,8 +379,6 @@ func (s Session) download(ctx context.Context, location string) (string, error) deadline := time.Now().Add(time.Minute) for { time.Sleep(tick) - // TODO(mpl): download starts late if it's a video. figure out if dl can only - // start after video has started playing or something like that? if !started && time.Now().After(deadline) { return "", fmt.Errorf("downloading in %q took too long to start", s.dlDir) }