Check for ENV["TMUX"] when using teamocil
This commit is contained in:
parent
2d012a241b
commit
bd247fef35
@ -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
|
||||
|
10
bin/teamocil
10
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
|
||||
|
Loading…
Reference in New Issue
Block a user