New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Find Vagrantfile with ascending directory. #221

Merged
merged 1 commit into from Jul 27, 2013

Conversation

Projects
None yet
2 participants
@ryotarai
Contributor

ryotarai commented Jul 26, 2013

Vagrantfile lookup path

Vagrant climbs up the directory tree looking for the first Vagrantfile it can find, starting first in the current directory.

http://docs.vagrantup.com/v2/vagrantfile/index.html

Improvement

serverspec-init climbs up the directory tree looking for the first Vagrantfile it can find, starting first in the current directory.

Log

➜  grandchild  pwd
/tmp/serverspec/child/grandchild
➜  grandchild  ls /tmp{,/serverspec,/serverspec/child,/serverspec/child/grandchild}/Vagrantfile
ls: /tmp/Vagrantfile: No such file or directory
ls: /tmp/serverspec/Vagrantfile: No such file or directory
ls: /tmp/serverspec/child/Vagrantfile: No such file or directory
ls: /tmp/serverspec/child/grandchild/Vagrantfile: No such file or directory
➜  grandchild  ./bin/serverspec-init
Select a backend type:

  1) SSH
  2) Exec (local)

Select number: 1

Vagrant instance y/n: y
Auto-configure Vagrant from Vagrantfile? y/n: y
Vagrantfile not found in directory!
➜  grandchild  cd ../..
➜  serverspec  vagrant init precise64
A `Vagrantfile` has been placed in this directory. You are now
ready to `vagrant up` your first virtual environment! Please read
the comments in the Vagrantfile as well as documentation on
`vagrantup.com` for more information on using Vagrant.
➜  serverspec  cd child/grandchild
➜  grandchild  ./bin/serverspec-init
Select a backend type:

  1) SSH
  2) Exec (local)

Select number: 1

Vagrant instance y/n: y
Auto-configure Vagrant from Vagrantfile? y/n: y
 + spec/
 + spec/default/
 + spec/default/httpd_spec.rb
 + spec/spec_helper.rb
 + Rakefile

@mizzy mizzy merged commit c4f425c into mizzy:master Jul 27, 2013

1 check passed

default The Travis CI build passed
Details
@mizzy

This comment has been minimized.

Show comment
Hide comment
@mizzy

mizzy Jul 27, 2013

Owner

Thanks!

I've merged and released as v0.7.2.

Owner

mizzy commented Jul 27, 2013

Thanks!

I've merged and released as v0.7.2.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment