Skip to content

Commit

Permalink
Fixed command not being compatible with mkdocs newer image
Browse files Browse the repository at this point in the history
  • Loading branch information
juanjol committed Oct 1, 2024
1 parent bc9b467 commit 0f8c752
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 12 deletions.
7 changes: 3 additions & 4 deletions commands/mkdocs/mkdocs
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
#!/bin/bash

#!/bin/sh
#ddev-generated

## Description: Run mkdocs commands
## Usage: mkdocs [args]
## Example: "ddev mkdocs build"
## ExecRaw: true

if [ "$1" == "serve" ]; then
if [ "$1" = "serve" ]; then
echo "This does not work for mkdocs in ddev"
exit 1
fi

mkdocs "${@:1}"
mkdocs "${@}"
26 changes: 18 additions & 8 deletions tests/test.bats
Original file line number Diff line number Diff line change
Expand Up @@ -8,26 +8,36 @@ setup() {
ddev delete -Oy ${PROJNAME} >/dev/null 2>&1 || true
cd "${TESTDIR}"
ddev config --project-name=${PROJNAME}
ddev get metadrop/ddev-aljibe
ddev start -y >/dev/null
ddev aljibe-assistant --auto
}

health_checks() {
echo "Checking mkdocs health" >&3
ddev exec wget http://mkdocs:8080 -q -O - | grep Welcome | grep -m1 "Welcome to Mkdocs"
}

teardown() {
check_build_mkdocs() {
echo "Checking mkdocs build" >&3
ddev mkdocs build
}

t() {
set -eu -o pipefail
cd ${TESTDIR} || ( printf "unable to cd to ${TESTDIR}\n" && exit 1 )
ddev delete -Oy ${PROJNAME} >/dev/null 2>&1
[ "${TESTDIR}" != "" ] && rm -rf ${TESTDIR}
}

@test "install from release" {
@test "Install from folder" {
set -eu -o pipefail
cd ${TESTDIR} || ( printf "unable to cd to ${TESTDIR}\n" && exit 1 )
echo "# ddev get metadrop/ddev-mkdocs with project ${PROJNAME} in ${TESTDIR} ($(pwd))" >&3
ddev get metadrop/ddev-mkdocs
ddev restart >/dev/null
cd ${TESTDIR}
echo "# ddev get ${DIR} with project ${PROJNAME} in ${TESTDIR} ($(pwd))" >&3
ddev get ${DIR}
echo "Installed add-on from directory, restarting ddev" >&3
ddev restart
echo "Testing mkdocs" >&3
health_checks
}

check_build_mkdocs
}

0 comments on commit 0f8c752

Please sign in to comment.