diff --git a/container-compose b/container-compose index 3582842..b48ed54 100755 --- a/container-compose +++ b/container-compose @@ -1,8 +1,8 @@ #!/bin/bash check_file() { - local file="" - local engine="" + file="" + engine="" local opt local OPTARG local OPTIND=1 @@ -54,11 +54,11 @@ check_file() { file="container-compose.yml" else echo "no compose.yaml, compose.yml, docker-compose.yaml, docker-compose.yml, podman-compose.yml, podman-compose.yaml, container-compose.yaml or container-compose.yml file found, pass files with -f" - return 1 + exit 1 fi elif [ ! -f "$file" ]; then echo "File $file not found." - return 1 + exit 1 fi # Set engine based on file if engine is not set @@ -77,7 +77,17 @@ check_file() { esac fi - # Output the file and engine being used - echo "Using $file with engine $engine" +if ! command -v "$engine" &> /dev/null +then + echo "$engine Not found. Please install $engine or use a different engine. Specify with --engine=engine_name" + exit 1 +fi + } check_file "$@" + + +# Output the file and engine being used +echo "Using $file with engine $engine" + +