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
|
$ gem install teamocil
|
||||||
$ mkdir ~/.teamocil
|
$ mkdir ~/.teamocil
|
||||||
$ touch ~/.teamocil/sample.yml
|
$ touch ~/.teamocil/sample.yml
|
||||||
|
$ tmux
|
||||||
$ teamocil sample
|
$ teamocil sample
|
||||||
|
|
||||||
# Layout example
|
# Layout example
|
||||||
|
@ -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
|
||||||
|
Loading…
Reference in New Issue
Block a user