diff --git a/CHANGELOG.md b/CHANGELOG.md index a4532244d..d247221a8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,8 @@ TTY (and hence can't confirm). [GH-779] - Fix an issue with the `:vagrantfile_name` option to `Vagrant::Environment` not working properly. [GH-778] + - `VAGRANT_CWD` environmental variable can be used to set the CWD to + something other than the current directory. ## 1.0.0 (March 6, 2012) diff --git a/lib/vagrant/environment.rb b/lib/vagrant/environment.rb index f11923ee2..efd800546 100644 --- a/lib/vagrant/environment.rb +++ b/lib/vagrant/environment.rb @@ -56,6 +56,7 @@ module Vagrant }.merge(opts || {}) # Set the default working directory to look for the vagrantfile + opts[:cwd] ||= ENV["VAGRANT_CWD"] if ENV.has_key?("VAGRANT_CWD") opts[:cwd] ||= Dir.pwd opts[:cwd] = Pathname.new(opts[:cwd]) diff --git a/test/unit/vagrant/environment_test.rb b/test/unit/vagrant/environment_test.rb index 4a51047c4..2df46366b 100644 --- a/test/unit/vagrant/environment_test.rb +++ b/test/unit/vagrant/environment_test.rb @@ -20,6 +20,10 @@ describe Vagrant::Environment do instance = described_class.new(:cwd => "foobarbaz") instance.cwd.should == Pathname.new("foobarbaz") end + + it "is set to the environmental variable VAGRANT_CWD" do + pending "A good temporary ENV thing" + end end describe "home path" do