diff --git a/smug.go b/smug.go index 6b8d796..5cfa692 100644 --- a/smug.go +++ b/smug.go @@ -84,7 +84,7 @@ func (smug Smug) StartSession(config Config, windows []string) error { } for _, w := range config.Windows { - if (len(windows) == 0 && w.Manual == true) || (len(windows) > 0 && !Contains(windows, w.Name)) { + if (len(windows) == 0 && w.Manual) || (len(windows) > 0 && !Contains(windows, w.Name)) { continue } @@ -104,7 +104,10 @@ func (smug Smug) StartSession(config Config, windows []string) error { paneRoot = filepath.Join(windowRoot, p.Root) } - smug.tmux.SplitWindow(window, p.Type, paneRoot, p.Commands) + _, err = smug.tmux.SplitWindow(window, p.Type, paneRoot, p.Commands) + if err != nil { + return err + } } } diff --git a/smug_test.go b/smug_test.go index 5d20a1e..6a85226 100644 --- a/smug_test.go +++ b/smug_test.go @@ -101,7 +101,10 @@ func TestStartSession(t *testing.T) { tmux := Tmux{commander} smug := Smug{tmux, commander} - smug.StartSession(params.config, params.windows) + err := smug.StartSession(params.config, params.windows) + if err != nil { + t.Fatalf("error %v", err) + } if !reflect.DeepEqual(params.commands, commander.Commands) { t.Errorf("expected\n%s\ngot\n%s", strings.Join(params.commands, "\n"), strings.Join(commander.Commands, "\n"))