Skip to content

Commit

Permalink
Set the site name property as part of the build installer process, so…
Browse files Browse the repository at this point in the history
… that you don't end up with 'html' when you install from within ddev.
  • Loading branch information
becw committed Sep 9, 2021
1 parent 8f5beee commit 6a17669
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 5 deletions.
5 changes: 3 additions & 2 deletions defaults.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,9 @@ drupal:
dir: default

# REQUIRED: Your site's URI; the default should be the URI of your local
# development environment.
uri: "https://${projectname}.ddev.site"
# development environment. This must be present in your
# .the-build/build.yml file.
# uri: "https://${projectname}.ddev.site"

# Customizing the following values is OPTIONAL. If these values are not
# explicitly configured, they will be set in the-build.xml based on the
Expand Down
2 changes: 2 additions & 0 deletions defaults/install/the-build/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
# found in the-build's repository.
# @see https://github.com/palantirnet/the-build/blob/release-2.0/defaults.yml

projectname: ${projectname}

# These properties are used when building the settings.php and settings.yml for your
# Drupal site, and by some of the targets in the default build.xml file.
# @see .the-build/drupal/services.build.yml
Expand Down
5 changes: 5 additions & 0 deletions targets/install.xml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,12 @@
<mkdir dir="${application.startdir}/config" />
<echo message="${hash_salt}" file="${application.startdir}/config/salt.txt" />

<!-- Prompt for the site name. -->
<propertyprompt propertyName="projectname.new" defaultValue="${projectname}" promptText="Machine name for this project" promptCharacter=":" />
<property name="projectname" value="${projectname.new}" override="true" />

<!-- Prompt for the Drupal URI. -->
<property name="default.drupal.sites.default.uri" value="https://${projectname}.ddev.site" />
<propertyprompt propertyName="drupal.sites.default.uri" defaultValue="${default.drupal.sites.default.uri}" promptText="Drupal URI" promptCharacter=":" />

<!-- Prompt for the web host. -->
Expand Down
5 changes: 2 additions & 3 deletions targets/the-build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,6 @@
<!-- Alias the build directory to the Phing start directory. -->
<property name="build.dir" value="${application.startdir}" />

<!-- Use the project directory name as the project name -->
<basename property="projectname" file="${build.dir}" suffix="local" />

<!-- Provide the path to the-build's code for loading templates and defaults -->
<!-- Phing maps the project name "the-build" to "the_build". -->
<resolvepath file="${phing.dir.the_build}/../" propertyName="build.thebuild.dir" />
Expand Down Expand Up @@ -87,6 +84,8 @@
</then>
</if>

<!-- Use the project directory name as the project name, if it's not configured. -->
<basename property="projectname" file="${build.dir}" suffix="local" />

<!-- Configure the 'drush' Phing task. -->
<property name="drush.bin" value="${build.dir}/vendor/bin/drush" />
Expand Down

0 comments on commit 6a17669

Please sign in to comment.