From 78235a052dd7ae25b5dc029361b4b3f01ed322d2 Mon Sep 17 00:00:00 2001 From: Chris Thompson Date: Wed, 29 Aug 2018 15:47:06 -0400 Subject: [PATCH] Support spaces in project folder name --- provisioning/box/drutopiavm.rb | 2 +- provisioning/box/pre-tasks/00-name_by_path.yml | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/provisioning/box/drutopiavm.rb b/provisioning/box/drutopiavm.rb index d9423d3..a12e94b 100644 --- a/provisioning/box/drutopiavm.rb +++ b/provisioning/box/drutopiavm.rb @@ -1,6 +1,6 @@ def set_overrides_per_project(config) # Acquire a hostname from the project root - project_dir_name = File.basename(ENV['DRUPALVM_PROJECT_ROOT']).gsub("_", "-") + project_dir_name = File.basename(ENV['DRUPALVM_PROJECT_ROOT']).gsub("_", "-").gsub(" ", "-") host_name = "#{project_dir_name}.test" # Override all vconfig values with the new names diff --git a/provisioning/box/pre-tasks/00-name_by_path.yml b/provisioning/box/pre-tasks/00-name_by_path.yml index b1b8cb1..628031a 100644 --- a/provisioning/box/pre-tasks/00-name_by_path.yml +++ b/provisioning/box/pre-tasks/00-name_by_path.yml @@ -7,9 +7,9 @@ delegate_to: localhost become: false -- name: remove underscores from folder name +- name: remove spaces and underscores from folder name set_fact: - proj_root_safe: "{{ proj_root.stdout|basename|replace('_','-') }}" + proj_root_safe: "{{ proj_root.stdout|basename|replace('_','-')|replace(' ','-') }}" # These values are NOT honored by Vagrant, but are still necessary for DrupalVM # See also provisioning/box/config