Skip to content

Commit b6654ba

Browse files
committed
shell script output fixes, cleanup, typos
1 parent c02166f commit b6654ba

File tree

4 files changed

+20
-14
lines changed

4 files changed

+20
-14
lines changed

bin/docker-entrypoint-iop.sh

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,22 @@
11
#!/bin/bash
22

3+
RESET="\033[0m"
4+
BOLD="\033[1m"
5+
GOLD="\033[33m"
6+
37
if [[ "$1" == init ]]; then
4-
/usr/local/bin/wp-init.sh
5-
/usr/local/bin/permissions.sh
6-
/usr/local/bin/getting-started.sh
8+
OWNER_GROUP=$(stat -c "%u:%g" /usr/src/site)
9+
. /usr/local/bin/wp-init.sh
10+
. /usr/local/bin/permissions.sh
11+
. /usr/local/bin/getting-started.sh
712
exit 0
813
fi
914

1015
# TODO: Remove once we're certain it's unused
1116
# This was never called. docker-compose files replace the entrypoint instead
1217
if [[ "$1" == permissions ]]; then
13-
echo "DEPRECATED: Replace the entrypoint with /usr/local/bin/permissions"
14-
echo " or call from docker-compose."
18+
echo "${GOLD}DEPRECATED: Replace the entrypoint with /usr/local/bin/permissions${RESET}"
19+
echo "${GOLD} or call from docker-compose. (docker-entrypoint.sh)${RESET}"
1520
/usr/local/bin/permissions.sh
1621
exit 0
1722
fi

bin/permissions.sh

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,13 @@ if [[ -z $OWNER_GROUP ]]; then
2424
# be root, but on Linux it will match the active host user.
2525

2626
echo -e "${GOLD}DEPRECATED: ${BOLD}\$OWNER_GROUP${RESET}${GOLD} should be defined in the environment, or from docker-compose.${RESET}"
27-
echo -e "${GOLD} Falling back to an internal definition. This will fail if \`/usr/src/site\` does not exist.${RESET}"
27+
echo -e "${GOLD} Falling back to internal definition. This run will fail if \`/usr/src/site\` does not exist. (permissions.sh)${RESET}"
2828

2929
OWNER_GROUP=$(stat -c "%u:%g" /usr/src/site)
3030
fi
3131

32-
echo -e "${GOLD}Resetting permissions"
32+
echo
33+
echo -e "${GOLD}${BOLD}Resetting permissions${RESET}"
3334

3435
# This list is intentionally granular for files outside of the theme directory
3536
TOP_LEVEL_FILES=(
@@ -60,7 +61,7 @@ find /usr/src/boilerplate-tooling -type f -printf "%P\n" | while read f; do
6061
echo -ne "${DO}${GOLD} Resetting permissions: Boilerplate tooling: ${CYAN}${f}${CLEAR}\r"
6162
chown -f "${OWNER_GROUP}" "/usr/src/site/${f}"
6263
chmod -f 0664 "/usr/src/site/${f}"
63-
sleep 0.8s
64+
sleep 0.2s
6465
done
6566
echo -e "${DONE} Boilerplate tooling${CLEAR}"
6667
sleep 0.2s
@@ -89,4 +90,4 @@ find /usr/src/site/wp-content -type f -wholename '*acf-json/*.json' -exec chown
8990
echo -e "${DONE} acf-json Permissions & Ownership${CLEAR}"
9091
sleep 0.2s
9192

92-
echo -e "${DONE}${GREEN} Done!${CLEAR}"
93+
echo -e "${DONE}${GREEN} Done!${RESET}"

bin/pull.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,11 @@ CYAN="\033[36m"
1717
FAIL="\r${RED}${BOLD}×${RESET} "
1818

1919
if [[ -z $OWNER_GROUP ]]; then
20-
# Lifted from permissions.sh, used to exsure _db, uploads and plugins have correct ownership & permissions
20+
# Lifted from permissions.sh, used to ensure _db, uploads and plugins have correct ownership & permissions
2121
# NOTE: Definiing this variable in the script is a fallback and probably deprecated or only for testing.
22-
# The value should be definied from the docker call or from the docker-compose file.
22+
# The value should already be defined before this script is called. (eg. the docker call or in docker-compose)
2323
echo -e "${GOLD}DEPRECATED: ${BOLD}\$OWNER_GROUP${RESET}${GOLD} should be defined in the environment, or from docker-compose.${RESET}"
24-
echo -e "${GOLD} Falling back to an internal definition. This will fail if \`/usr/src/site\` does not exist.${RESET}"
24+
echo -e "${GOLD} Falling back to internal definition. This run will fail if \`/usr/src/site\` does not exist. (pull.sh)${RESET}"
2525

2626
OWNER_GROUP=$(stat -c "%u:%g" /usr/src/site)
2727
fi

bin/wp-init.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ if [[ -z "$DESCRIPTION" ]]; then
6767
fi
6868

6969
echo
70-
echo -e "${BOLD}Setting up WordPress environment${RESET}"
70+
echo -e "${GOLD}${BOLD}Setting up WordPress environment${RESET}"
7171
echo -e "Theme name: ${CYAN}${NAME}${RESET}"
7272
if [[ -n "$DESCRIPTION" ]]; then
7373
echo -e "Description: ${CYAN}${DESCRIPTION}${RESET}"
@@ -151,7 +151,7 @@ echo -e "$DONE"
151151
# install everything from package.json but won't rewrite package-lock.json
152152
if [[ ! -s /usr/src/site/package-lock.json ]]; then
153153
echo -ne "${DO}Creating placeholder ${CYAN}package-lock.json${RESET} file"
154-
echo '{"lockfileVersion":2}' > /usr/src/site/package-lock.json
154+
echo '{"lockfileVersion":2}' >/usr/src/site/package-lock.json
155155
sleep 0.2s
156156
echo -e "$DONE"
157157
fi

0 commit comments

Comments
 (0)