mirror of
https://github.com/tmuxinator/tmuxinator.git
synced 2026-03-11 18:24:23 -05:00
* #663 - add support for project config files using .yaml extension
This commit is contained in:
@@ -1,3 +1,6 @@
|
||||
## UNRELEASED
|
||||
- add support for project config files using .yaml extension
|
||||
|
||||
## 0.14.0
|
||||
### Misc
|
||||
- Add `--suppress-tmux-version-warning` flag to prevent tmux version warning (#583)
|
||||
|
||||
@@ -181,8 +181,8 @@ module Tmuxinator
|
||||
# recursively searching 'directory'
|
||||
def project_in(directory, name)
|
||||
return nil if String(directory).empty?
|
||||
projects = Dir.glob("#{directory}/**/*.yml").sort
|
||||
projects.detect { |project| File.basename(project, ".yml") == name }
|
||||
projects = Dir.glob("#{directory}/**/*.{yml,yaml}").sort
|
||||
projects.detect { |project| File.basename(project, ".*") == name }
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
40
spec/fixtures/yaml.yaml
vendored
Normal file
40
spec/fixtures/yaml.yaml
vendored
Normal file
@@ -0,0 +1,40 @@
|
||||
# ~/.tmuxinator/sample.yml
|
||||
# you can make as many tabs as you wish...
|
||||
|
||||
name: sample
|
||||
root: ~/test
|
||||
socket_name: foo # Remove to use default socket
|
||||
pre_window: rbenv shell 2.0.0-p247 # Runs in each tab and pane
|
||||
tmux_options: -f ~/.tmux.mac.conf # Pass arguments to tmux
|
||||
tmux_detached: false
|
||||
windows:
|
||||
- editor:
|
||||
pre:
|
||||
- echo "I get run in each pane, before each pane command!"
|
||||
-
|
||||
layout: main-vertical
|
||||
panes:
|
||||
- vim
|
||||
- #empty, will just run plain bash
|
||||
- top
|
||||
- pane_with_multiple_commands:
|
||||
- ssh server
|
||||
- echo "Hello"
|
||||
- shell:
|
||||
- git pull
|
||||
- git merge
|
||||
- guard:
|
||||
layout: tiled
|
||||
pre:
|
||||
- echo "I get run in each pane."
|
||||
- echo "Before each pane command!"
|
||||
panes:
|
||||
-
|
||||
- #empty, will just run plain bash
|
||||
-
|
||||
- database: bundle exec rails db
|
||||
- server: bundle exec rails s
|
||||
- logs: tail -f log/development.log
|
||||
- console: bundle exec rails c
|
||||
- capistrano:
|
||||
- server: ssh user@example.com
|
||||
@@ -246,6 +246,7 @@ describe Tmuxinator::Config do
|
||||
let(:directory) { Tmuxinator::Config.directory }
|
||||
let(:base) { "#{directory}/sample.yml" }
|
||||
let(:first_dup) { "#{home_config_dir}/dup/local-dup.yml" }
|
||||
let(:yaml) { "#{directory}/yaml.yaml" }
|
||||
|
||||
before do
|
||||
allow(Tmuxinator::Config).to receive_messages(xdg: fixtures_dir)
|
||||
@@ -258,6 +259,12 @@ describe Tmuxinator::Config do
|
||||
end
|
||||
end
|
||||
|
||||
context "with project yaml" do
|
||||
it "gets the project as path to the yaml file" do
|
||||
expect(Tmuxinator::Config.global_project("yaml")).to eq yaml
|
||||
end
|
||||
end
|
||||
|
||||
context "without project yml" do
|
||||
it "gets the project as path to the yml file" do
|
||||
expect(Tmuxinator::Config.global_project("new-project")).to be_nil
|
||||
|
||||
Reference in New Issue
Block a user