Compare commits

..

2 Commits

Author SHA1 Message Date
b30cc46739 add convenience script for wp scaffolding 2023-12-24 11:47:40 -06:00
3e9a020b20 add development stuff
rename submodule

add theme
2023-12-24 11:46:39 -06:00
3 changed files with 33 additions and 0 deletions

3
.gitmodules vendored
View File

@@ -4,3 +4,6 @@
[submodule "cmbabaseball/data/plugins/cimba"]
path = cmbabaseball/data/plugins/cimba
url = https://gitea.ascorrea.com/asc/cimba.git
[submodule "cmbabaseball/data/themes/tonys-rookie-enhancements"]
path = cmbabaseball/data/themes/tonys-rookie-enhancements
url = https://gitea.ascorrea.com/asc/tonys-rookie-enhancements.git

29
cmbabaseball/scaffold.sh Executable file
View File

@@ -0,0 +1,29 @@
#!/bin/zsh
# Script Name: scaffold.sh
# Description: Convenience script to create things using WP-CLI scaffold command
#
# Usage: ./scaffold.sh COMMAND SLUG OPTIONS
# Example:
cd "$(dirname "$0")"
CONTAINER_NAME=cmbabaseball
# Check if the number of arguments is less than 1 (i.e., PLUGIN_NAME is not provided)
if [ "$#" -lt 2 ]; then
echo "Error: Not enough arguments."
echo "Usage: $0 COMMAND SLUG OPTIONS"
exit 1
fi
COMMAND=$1
SLUG=$2
OPTIONS=$3
WP_COMMAND="wp scaffold ${COMMAND} ${SLUG} ${OPTIONS}"
echo $WP_COMMAND
# WP_COMMAND="echo 'hello'"
# WP_COMMAND="wp scaffold child-theme"
echo $WP_COMMAND
NEW_PLUGIN_CONTAINER_LOCATION=$(./docker-run.sh --attach stdout --attach stderr -e WPCLI_COMMAND="$WP_COMMAND" wordpress:cli sh -c 'eval $WPCLI_COMMAND' | sed -rn "s/.*Success: Created '(.*)'.*/\1/gp")
echo $NEW_PLUGIN_CONTAINER_LOCATION
docker cp ${CONTAINER_NAME}:${NEW_PLUGIN_CONTAINER_LOCATION} ./data/themes/