Skip to content

Commit

Permalink
Merge pull request #770 from dseevr/fix_vagrant_state
Browse files Browse the repository at this point in the history
Fixed a bug where values read from .vagrant-state were being set as envvars with trailing newlines attached
  • Loading branch information
Joji Mekkatt authored Mar 6, 2017
2 parents bb50e9b + 3a27bf5 commit c8b79a5
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Vagrantfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,9 @@ require 'fileutils'
BEGIN {
STATEFILE = ".vagrant-state"

# if there's a state file, set all the envvars in the current environment
if File.exist?(STATEFILE)
File.open(STATEFILE).read.lines.map { |x| x.split("=", 2) }.each { |x,y| ENV[x] = y }
File.read(STATEFILE).lines.map { |x| x.split("=", 2) }.each { |x,y| ENV[x] = y.strip }
end
}

Expand Down

0 comments on commit c8b79a5

Please sign in to comment.