Skip to content

Commit 4d52a47

Browse files
Preserve non-empty PROJECT_FILES environment variable (#150)
* Preserve non-empty PROJECT_FILES environment variable * Unbound var * Update symlink-project --------- Co-authored-by: Moshe Weitzman <weitzman@tejasa.com>
1 parent 6464f2f commit 4d52a47

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

commands/web/symlink-project

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,15 @@ export _WEB_ROOT=$DDEV_DOCROOT
1313
cd "$DDEV_COMPOSER_ROOT" || exit
1414
curl -OL https://git.drupalcode.org/project/gitlab_templates/-/raw/default-ref/scripts/symlink_project.php
1515

16-
# Suppress a warning.
17-
PROJECT_FILES=$(ls -A --ignore="web" --ignore="vendor" --ignore="symlink_project.php" --ignore=".ddev" --ignore=".idea")
18-
export PROJECT_FILES
19-
# Used by the symlink-project script in gitlab_templates
16+
if [ -n "${PROJECT_FILES-}" ]; then
17+
# Suppress a warning.
18+
PROJECT_FILES=$(ls -A --ignore="web" --ignore="vendor" --ignore="symlink_project.php" --ignore=".ddev" --ignore=".idea")
19+
export PROJECT_FILES
20+
fi
21+
2022
# Symlink name using underscores.
2123
# @see https://www.drupal.org/docs/develop/creating-modules/naming-and-placing-your-drupal-module
24+
# DRUPAL_PROJECT_FOLDER is used by the symlink-project script in gitlab_templates
2225
export DRUPAL_PROJECT_FOLDER=${DDEV_DOCROOT}/${DRUPAL_PROJECTS_PATH}/${DDEV_SITENAME//-/_}
2326
php symlink_project.php
2427
rm -f symlink_project.php

0 commit comments

Comments
 (0)