diff --git a/README.mkd b/README.mkd index dc22023..30253c6 100644 --- a/README.mkd +++ b/README.mkd @@ -7,6 +7,7 @@ Teamocil is a tool used to automatically create windows and splits in `tmux` wit $ gem install teamocil $ mkdir ~/.teamocil $ touch ~/.teamocil/sample.yml + $ tmux $ teamocil sample # Layout example diff --git a/bin/teamocil b/bin/teamocil index 2c9b4e1..9bf3c9a 100755 --- a/bin/teamocil +++ b/bin/teamocil @@ -1,6 +1,10 @@ #!/usr/bin/env ruby -require "teamocil" +require File.dirname(__FILE__)+"/../lib/teamocil" -layout = Teamocil::Layout.new(ARGV[0], File.join("#{ENV["HOME"]}/.teamocil", "#{ARGV[0]}.yml")) -layout.to_tmux +if ENV["TMUX"] == nil + puts "You must be in a tmux session to use teamocil" +else + layout = Teamocil::Layout.new(ARGV[0], File.join("#{ENV["HOME"]}/.teamocil", "#{ARGV[0]}.yml")) + layout.to_tmux +end