Skip to content

Commit 6966a76

Browse files
committed
Restructure file organization to simplify setup
1 parent 6530581 commit 6966a76

File tree

12 files changed

+10
-80
lines changed

12 files changed

+10
-80
lines changed

configs/settings.sh

Lines changed: 0 additions & 67 deletions
This file was deleted.

configs/modules/constants.sh renamed to constants.sh

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
11
# Host machine directories.
2-
SCRIPT_DIR='ddev-wp-setup-script'
3-
MODULES_DIR="${SCRIPT_DIR}/modules"
4-
FILES_DIR="${SCRIPT_DIR}/files"
52
PROJECT_DIR=$(pwd)
63

74
# Get the project name from the project directory, minus any leading
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
#!/bin/bash
22

33
# Get the script constants
4-
source ddev-wp-setup-script/configs/modules/constants.sh
4+
source constants.sh
55

66
# Get the script settings
7-
source ${CONFIGS_DIR}/settings.sh
7+
source settings.sh
88

99
# Confirm WP_USER_EMAIL is a valid email address before proceeding
1010
if ! [[ "$WP_USER_EMAIL" =~ ^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$ ]]; then
@@ -18,22 +18,22 @@ ddev config --project-type=wordpress --project-name=$PROJECT_NAME_SLUG
1818

1919
# Add Spatie Ray app files for development env.
2020
if $INSTALL_RAY_CONNECTIONS; then
21-
source ${MODULES_DIR}/ray-app-connections-module.sh
21+
source /modules/ray-app-connections-module.sh
2222
fi
2323

2424
# Add WordPress debugging log for WP development.
2525
if $INSTALL_WP_DEBUG_SETTING; then
26-
source ${MODULES_DIR}/wp-debug-log-setup-module.sh
26+
source /modules/wp-debug-log-setup-module.sh
2727
fi
2828

2929
# Add git and git assets.
3030
if $INSTALL_GIT; then
31-
source ${MODULES_DIR}/git-local-setup-module.sh
31+
source /modules/git-local-setup-module.sh
3232
fi
3333

3434
# Build and start the project's Docker containers.
3535
printf "${BLUE}Starting DDEV containers...${RESET}\n"
3636
ddev start $PROJECT_NAME_SLUG
3737

3838
# Install and set up WordPress for development.
39-
source ${MODULES_DIR}/wp-starter-setup-module.sh
39+
source /modules/wp-starter-setup-module.sh

configs/modules/git-local-setup-module.sh renamed to modules/git-local-setup-module.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ if [ -f ".gitignore" ]; then
1616
printf "${BLACK}The .gitignore file already exists. Skipping creation.${RESET}\n"
1717
else
1818
# Copy/Paste file
19-
cp ${FILES_DIR}/.gitignore ./
19+
cp /files/.gitignore ./
2020
# Update .gitignore allow list to include custom theme
2121
sed -i '' "s|# \!wp-content/themes/theme-name|\!wp-content/themes/${STARTER_THEME_SLUG}|g" .gitignore
2222
# Print success message

configs/modules/ray-app-connections-module.sh renamed to modules/ray-app-connections-module.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ else
1111
# Create the directories if they don't exist.
1212
mkdir -p "$(dirname "$ray_ini")"
1313
# Copy/Paste file
14-
cp ${FILES_DIR}/php-ray.ini .ddev/php/
14+
cp /files/php-ray.ini .ddev/php/
1515
# Print success message
1616
printf "${GREEN}File created at: ${BOLD}${ray_ini}${RESET}\n"
1717
fi
@@ -27,7 +27,7 @@ else
2727
# Create the directories if they don't exist
2828
mkdir -p "$(dirname "$ray_dockerfile")"
2929
# Copy/Paste file
30-
cp ${FILES_DIR}/Dockerfile .ddev/web-build/
30+
cp /files/Dockerfile .ddev/web-build/
3131
# Print success message
3232
printf "${GREEN}File created at: ${BOLD}${ray_dockerfile}${RESET}\n"
3333
fi
@@ -40,7 +40,7 @@ if [ -f "ray.php" ]; then
4040
printf "${BLACK}The ray.php file already exists. Skipping creation.${RESET}\n"
4141
else
4242
# Copy/Paste file
43-
cp ${FILES_DIR}/ray.php ./
43+
cp /files/ray.php ./
4444
# Update file's local_path string
4545
sed -i '' "s|LOCAL_PROJECT_DIR|${PROJECT_DIR}|g" ray.php
4646
# Print success message

0 commit comments

Comments
 (0)