From d3d8a6de1b29d922295799d6fc54783f9da9613e Mon Sep 17 00:00:00 2001 From: Ivan Savenko Date: Tue, 27 Dec 2022 17:19:28 +0200 Subject: [PATCH] Fix directory test --- vcmibuilder | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/vcmibuilder b/vcmibuilder index 497de28ea..6d3555e24 100755 --- a/vcmibuilder +++ b/vcmibuilder @@ -87,6 +87,11 @@ warning () warn_user=true } +#checks whether specified directory exists. Also works with globs +dir_exists() { + [ -d "$1" ] +} + # check if selected options are correct. if [[ -n "$data_dir" ]] @@ -177,7 +182,7 @@ then cd "$data_dir" && innoextract "$gog_file" # some versions of gog.com installer (or innoextract tool?) place game files inside /app directory - if [[ -d "$data_dir"/app/[Dd][Aa][Tt][Aa] ]] + if dir_exists "$data_dir"/app/[Dd][Aa][Tt][Aa] then data_dir="$data_dir"/app fi