Created
November 22, 2017 17:22
-
-
Save arbalest/bbc2182887ccbaea3fb57c5336abfd64 to your computer and use it in GitHub Desktop.
Access Ruby variables in the Homestead.yaml file by means of string formatting in homestead.rb (Laravel Vagrant template)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# ... | |
# Register All Of The Configured Shared Folders | |
if settings.include? 'folders' | |
settings["folders"].each do |folder| | |
# folder["map"].sub!('{{USERPROFILE}}', ENV['USERPROFILE']) | |
folder["map"] = folder["map"] % { :USERPROFILE => ENV['USERPROFILE'] } | |
if File.exists? File.expand_path(folder["map"]) | |
# ... | |
end | |
end | |
end | |
# ... | |
# Yaml sample: | |
# folders: | |
# - map: "%{USERPROFILE}/tmp" | |
# to: /home/vagrant/apps | |
# options: | |
# fsnotify: true | |
# ... |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment