Check for ENV["TMUX"] when using teamocil

This commit is contained in:
Rémi Prévost 2011-02-05 13:54:34 -05:00
parent 2d012a241b
commit bd247fef35
2 changed files with 8 additions and 3 deletions

View File

@ -7,6 +7,7 @@ Teamocil is a tool used to automatically create windows and splits in `tmux` wit
$ gem install teamocil $ gem install teamocil
$ mkdir ~/.teamocil $ mkdir ~/.teamocil
$ touch ~/.teamocil/sample.yml $ touch ~/.teamocil/sample.yml
$ tmux
$ teamocil sample $ teamocil sample
# Layout example # Layout example

View File

@ -1,6 +1,10 @@
#!/usr/bin/env ruby #!/usr/bin/env ruby
require "teamocil" require File.dirname(__FILE__)+"/../lib/teamocil"
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 = Teamocil::Layout.new(ARGV[0], File.join("#{ENV["HOME"]}/.teamocil", "#{ARGV[0]}.yml"))
layout.to_tmux layout.to_tmux
end