Skip to content

Commit

Permalink
preserve quotes
Browse files Browse the repository at this point in the history
  • Loading branch information
thomasplevy committed Dec 16, 2021
1 parent 8fcd453 commit 3f62cbb
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
LifterLMS Tests Changelog
=========================

v3.3.1 - 2021-12-16
-------------------

+ Fixed issues encountered when passing command arguments containing quotes into the `wp` command.


v3.3.0 - 2021-12-13
-------------------

Expand Down
10 changes: 7 additions & 3 deletions bin/llms-env
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ COMPOSE_OVERRIDE="./docker-compose.yml"
FILE_OPT="-f $COMPOSE_MAIN";
[ -f "$COMPOSE_OVERRIDE" ] && FILE_OPT="-f $COMPOSE_OVERRIDE $FILE_OPT"


DOCKER_CMD="docker-compose --env-file $ENV_FILE $FILE_OPT"

HELP_OPTIONS_HELP=$'-h, --help\n Display this help message'
Expand Down Expand Up @@ -247,12 +246,17 @@ elif [ "wp" == $COMMAND ]; then
if [[ "-h" == $2 || "--help" == $2 ]]; then
output_help "wp" "$0 wp [-h | --help] <command...> [options...]" "Executes a wp-cli command inside the PHP service container" "$HELP_OPTIONS_HELP"
else
docker exec $($DOCKER_CMD ps -q wordpress) wp --allow-root ${*:2}

ARGS=""
for arg in "${@:2}"; do
ARGS="$ARGS "$arg""
done
docker exec $($DOCKER_CMD ps -q wordpress) bash -c "wp --allow-root $ARGS"

fi

else

echo "llms-env: '$1' is not a valid command. See '$0 --help' for usage information.";

fi;

0 comments on commit 3f62cbb

Please sign in to comment.