What is Nostr?
duong / Daniel Dương
npub1d8c…we69
2023-07-28 00:25:45
in reply to nevent1q…el7r

duong on Nostr: Ok, let's say I wanna test this script, without installing docker-compose: $ cat ...

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.
Author Public Key
npub1d8ck6dx25zys7vhpju8prx30jm0p3y22kza9hjnvs74hy3tgkhuqeqwe69