remi / teamocil

There's no I in Teamocil. At least not where you think. Teamocil is a simple tool used to automatically create windows and panes in tmux with YAML files.
MIT License
2.36k stars 101 forks source link

Running a layout that doesn't specify a root option results in an exception #71

Closed johnhampton closed 10 years ago

johnhampton commented 10 years ago

I'm not sure if the root option is required, but if it isn't specified teamocil produces an exception. This is occurs in 1.0.3.

windows:
  - name: window-1
    panes:
      - ls
Deep-Thought:~ $ teamocil test
/Users/john/.rbenv/versions/2.0.0-p451/lib/ruby/gems/2.0.0/gems/teamocil-1.0.3/lib/teamocil/tmux/window.rb:8:in `expand_path': no implicit conversion of nil into String (TypeError)
        from /Users/john/.rbenv/versions/2.0.0-p451/lib/ruby/gems/2.0.0/gems/teamocil-1.0.3/lib/teamocil/tmux/window.rb:8:in `initialize'
        from /Users/john/.rbenv/versions/2.0.0-p451/lib/ruby/gems/2.0.0/gems/teamocil-1.0.3/lib/teamocil/tmux/session.rb:15:in `new'
        from /Users/john/.rbenv/versions/2.0.0-p451/lib/ruby/gems/2.0.0/gems/teamocil-1.0.3/lib/teamocil/tmux/session.rb:15:in `block in initialize'
        from /Users/john/.rbenv/versions/2.0.0-p451/lib/ruby/gems/2.0.0/gems/teamocil-1.0.3/lib/teamocil/tmux/session.rb:10:in `each'
        from /Users/john/.rbenv/versions/2.0.0-p451/lib/ruby/gems/2.0.0/gems/teamocil-1.0.3/lib/teamocil/tmux/session.rb:10:in `each_with_index'
        from /Users/john/.rbenv/versions/2.0.0-p451/lib/ruby/gems/2.0.0/gems/teamocil-1.0.3/lib/teamocil/tmux/session.rb:10:in `each'
        from /Users/john/.rbenv/versions/2.0.0-p451/lib/ruby/gems/2.0.0/gems/teamocil-1.0.3/lib/teamocil/tmux/session.rb:10:in `map'
        from /Users/john/.rbenv/versions/2.0.0-p451/lib/ruby/gems/2.0.0/gems/teamocil-1.0.3/lib/teamocil/tmux/session.rb:10:in `initialize'
        from /Users/john/.rbenv/versions/2.0.0-p451/lib/ruby/gems/2.0.0/gems/teamocil-1.0.3/lib/teamocil/layout.rb:49:in `new'
        from /Users/john/.rbenv/versions/2.0.0-p451/lib/ruby/gems/2.0.0/gems/teamocil-1.0.3/lib/teamocil/layout.rb:49:in `parsed_layout'
        from /Users/john/.rbenv/versions/2.0.0-p451/lib/ruby/gems/2.0.0/gems/teamocil-1.0.3/lib/teamocil/layout.rb:37:in `shell_commands'
        from /Users/john/.rbenv/versions/2.0.0-p451/lib/ruby/gems/2.0.0/gems/teamocil-1.0.3/lib/teamocil/layout.rb:7:in `execute!'
        from /Users/john/.rbenv/versions/2.0.0-p451/lib/ruby/gems/2.0.0/gems/teamocil-1.0.3/lib/teamocil/cli.rb:21:in `run!'
        from /Users/john/.rbenv/versions/2.0.0-p451/lib/ruby/gems/2.0.0/gems/teamocil-1.0.3/bin/teamocil:7:in `<top (required)>'
        from /Users/john/.rbenv/versions/2.0.0-p451/bin/teamocil:23:in `load'
        from /Users/john/.rbenv/versions/2.0.0-p451/bin/teamocil:23:in `<main>'
        from /Users/john/.rbenv/versions/2.0.0-p451/bin/ruby_executable_hooks:15:in `eval'
remi commented 10 years ago

Hi @johnhampton, I just fixed this with cb87c127ffef472421cf9dfa02edd24c53c05bcc

Thanks!