Don't allow a directory to be selected

The `-e` flag checks for a file _or_ a directory of that name. The `-f` flag checks only for files.
This commit is contained in:
Andrew Scheller 2018-01-21 22:08:43 +00:00 committed by GitHub
parent c40b443072
commit 2229ae89a6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -19,7 +19,7 @@ img="$1"
if [[ -z "$img" ]]; then if [[ -z "$img" ]]; then
usage usage
fi fi
if [[ ! -e "$img" ]]; then if [[ ! -f "$img" ]]; then
echo "ERROR: $img is not a file..." echo "ERROR: $img is not a file..."
exit -2 exit -2
fi fi