Reputation: 11
I'd like to set the name of my Vagrant VM to be the current working directory. I'd like to do something like this but apparently it's not valid:
config.vm.provider "virtualbox" do |vb|
vb.name = ENV[$PWD]
end
Suggestions are much appreciated
Thanks.
Upvotes: 1
Views: 786
Reputation: 53713
The following will work
config.vm.provider :virtualbox do |vb|
current_dir = File.basename(Dir.getwd)
vb.name = current_dir
end
Upvotes: 5