Use match instead of start_with
This commit is contained in:
parent
c95267fdda
commit
92104fec72
|
@ -161,7 +161,7 @@ module Vagrant
|
|||
# depending on whether it starts with the "{}" placeholder. Otherwise,
|
||||
# we use the default which is expanded relative to the root path.
|
||||
opts[:local_data_path] ||= ENV["VAGRANT_DOTFILE_PATH"] if !opts[:child]
|
||||
if opts[:local_data_path] && opts[:local_data_path].start_with?("{}") && !root_path.nil?
|
||||
if opts[:local_data_path] && opts[:local_data_path].match("^\{\}") && !root_path.nil?
|
||||
opts[:local_data_path] = File.join(root_path, opts[:local_data_path].sub(/^\{\}/, ''))
|
||||
end
|
||||
opts[:local_data_path] ||= root_path.join(DEFAULT_LOCAL_DATA) if !root_path.nil?
|
||||
|
|
Loading…
Reference in New Issue