dvbackup/test/mock-docker.sh

27 lines
499 B
Bash
Raw Normal View History

2022-08-30 22:26:52 +02:00
#!/usr/bin/env sh
volume() {
if [ "$1" = 'ls' ]; then
echo "DRIVER VOLUME NAME"
echo "local 00c674e3f3c1587d88c2ebf2f91da5843b9dddb3e8df272898bdfd4e596aef79"
echo "local $DOCKER_MOCK_VOLUME"
return 0
elif [ "$1" = 'inspect' ]; then
if [ "$2" = "$DOCKER_MOCK_VOLUME" ]; then
2022-08-30 22:26:52 +02:00
return 0
else
return 1
fi
else
docker volume "$@"
2022-08-30 22:26:52 +02:00
fi
}
if [ "$1" = "volume" ]; then
"$@"
else
docker "$@"
fi