I more or less just want to make sure that things are executing in the proper order and that the sections where i have user input are working correctly without necessarily installing a bunch of stuff on my computer.

Reply to this note

Please Login to reply.

Discussion

Ok, let's say I wanna test this script, without installing docker-compose:

$ cat manage.sh

#!/bin/sh

RUNNING_IDS=$(docker-compose ps -q)

if [ -z "$RUNNING_IDS" ]; then

echo "docker-compose is not running."

exit 1

fi

docker-compose exec -e LOG_LEVEL=${LOG_LEVEL:-INFO} backend python3 manage.py "$@"

I can use the PATH trick:

$ printf '#!/bin/sh' > docker-compose && chmod +x docker-compose && PATH=.:$PATH ./manage.sh

docker-compose is not running.

Here I create a docker-compose file (that is just an empty shell script), and called the script that I wanted to test with the current directory added to the PATH.

Sick when im off work ill test this. Thanks. Kinda new to shell scripting and making one that "holds the users hand" has been a fun challenge.