Prevent problems when we can't get metadata, usually because meta.cpp doesn't exist. Some mods don't seem to have one.

This commit is contained in:
Daniel Ceregatti 2023-10-12 21:55:41 -07:00
parent 4c09ef752c
commit a422694010

View file

@ -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}
}