Skip to content

Commit 8ddc8c9

Browse files
authored
fix: improve fallback setup (#147)
Allows fallback setup when DrupalPod is called with no DP_PROJECT_TYPE. That is the case when DrupalPod is called without using the browser extension.
1 parent e58c519 commit 8ddc8c9

File tree

3 files changed

+17
-13
lines changed

3 files changed

+17
-13
lines changed

.gitpod/drupal/drupalpod-setup/install_modules.sh renamed to .gitpod/drupal/drupalpod-setup/contrib_modules_setup.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
#!/usr/bin/env bash
2+
set -eu -o pipefail
23

34
# Check if additional modules should be installed
45
export DEVEL_NAME="devel"

.gitpod/drupal/drupalpod-setup/drupalpod-setup.sh

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,14 @@ convert_version() {
4444
# echo $(convert_version "11.0-dev") # Output: 11.x
4545

4646
# Skip setup if it already ran once and if no special setup is set by DrupalPod extension
47-
if [ ! -f "${GITPOD_REPO_ROOT}"/.drupalpod_initiated ] && [ -n "$DP_PROJECT_TYPE" ]; then
48-
source "$DIR/git_setup.sh"
47+
if [ ! -f "${GITPOD_REPO_ROOT}"/.drupalpod_initiated ]; then
48+
49+
# Set a default setup if project type wasn't specified
50+
if [ -z "$DP_PROJECT_TYPE" ]; then
51+
source "$DIR/fallback_setup.sh"
52+
fi
4953

54+
source "$DIR/git_setup.sh"
5055

5156
# If this is an issue fork of Drupal core - set the drupal core version based on that issue fork
5257
if [ "$DP_PROJECT_TYPE" == "project_core" ] && [ -n "$DP_ISSUE_FORK" ]; then
@@ -60,8 +65,7 @@ if [ ! -f "${GITPOD_REPO_ROOT}"/.drupalpod_initiated ] && [ -n "$DP_PROJECT_TYPE
6065
# Measure the time it takes to go through the script
6166
script_start_time=$(date +%s)
6267

63-
source "$DIR/fallback_setup.sh"
64-
source "$DIR/install_modules.sh"
68+
source "$DIR/contrib_modules_setup.sh"
6569
source "$DIR/cleanup.sh"
6670
source "$DIR/composer_setup.sh"
6771

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
11
#!/usr/bin/env bash
2+
set -eu -o pipefail
23

3-
# Set a default setup if project type wasn't specified
4-
if [ -z "$DP_PROJECT_TYPE" ]; then
5-
export DP_INSTALL_PROFILE='demo_umami'
6-
export DP_PROJECT_TYPE='project_core'
7-
export DP_PROJECT_NAME="drupal"
8-
export DP_CORE_VERSION='10.2.5'
9-
export DP_EXTRA_DEVEL=1
10-
export DP_EXTRA_ADMIN_TOOLBAR=1
11-
fi
4+
# Set a default setup (when project type is not specified)
5+
export DP_INSTALL_PROFILE='demo_umami'
6+
export DP_PROJECT_TYPE='project_core'
7+
export DP_PROJECT_NAME="drupal"
8+
export DP_CORE_VERSION='10.2.5'
9+
export DP_EXTRA_DEVEL=1
10+
export DP_EXTRA_ADMIN_TOOLBAR=1

0 commit comments

Comments
 (0)