From a422694010dfd1ed0aa059e257f36e3e1044c7db Mon Sep 17 00:00:00 2001 From: Daniel Ceregatti Date: Thu, 12 Oct 2023 21:55:41 -0700 Subject: [PATCH] Prevent problems when we can't get metadata, usually because meta.cpp doesn't exist. Some mods don't seem to have one. --- files/bin/dz-common | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/files/bin/dz-common b/files/bin/dz-common index dbd24a0..2d998eb 100755 --- a/files/bin/dz-common +++ b/files/bin/dz-common @@ -97,6 +97,11 @@ get_mod_name(){ exit 1 fi NAME=$(grep name ${WORKSHOP_DIR}/${1}/meta.cpp | cut -d '"' -f2 | tr -cd [:alnum:]) + if [[ ${NAME} = "" ]] + then + echo "Could not get metadata. See above. Exiting..." + exit 1 + fi echo -n ${NAME} }