#!/bin/bash

ERROR_OR_FIX=$1

### handling input 
if [ $# -eq 0 ]
then
    echo "No arguments supplied"
    exit
fi

case ${ERROR_OR_FIX} in
    "error")
        cp Dockerfile_error Dockerfile
        ;;
    "fix")
        cp Dockerfile_fix Dockerfile
        ;;
    *)
        echo "Could not find this option"
        exit
        ;;
esac
### done handling input

NAME=$(pwd | rev | cut -d/ -f1 | rev)

echo "=== containers and images (before) ==="
docker ps -a
docker images

echo "=== reproducing issue ==="
../../helper-scripts/startup "${NAME}"
echo "=== cleaning up ==="
../../helper-scripts/delete_last "${NAME}"
rm Dockerfile

echo "=== containers and images (after) ==="
docker ps -a
docker images


