From bd16fe70f9ffbf0bb6ae7cfd763554559f708a02 Mon Sep 17 00:00:00 2001 From: "A. Wilcox" Date: Sat, 12 Oct 2019 02:35:52 -0500 Subject: hscript: Only print MISSING_ERRORS if no other errors occurred --- hscript/script.cc | 30 ++++++++++++++++-------------- 1 file changed, 16 insertions(+), 14 deletions(-) (limited to 'hscript') diff --git a/hscript/script.cc b/hscript/script.cc index dbf845d..b5efa47 100644 --- a/hscript/script.cc +++ b/hscript/script.cc @@ -264,20 +264,22 @@ const Script *Script::load(std::istream &sstream, const ScriptOptions opts) { "this key is required");\ errors++; - if(!the_script->internal->network) { - MISSING_ERROR("network") - } - if(!the_script->internal->hostname) { - MISSING_ERROR("hostname") - } - if(the_script->internal->packages.size() == 0) { - MISSING_ERROR("pkginstall") - } - if(!the_script->internal->rootpw) { - MISSING_ERROR("rootpw") - } - if(the_script->internal->mounts.size() == 0) { - MISSING_ERROR("mount") + if(errors == 0) { + if(!the_script->internal->network) { + MISSING_ERROR("network") + } + if(!the_script->internal->hostname) { + MISSING_ERROR("hostname") + } + if(the_script->internal->packages.size() == 0) { + MISSING_ERROR("pkginstall") + } + if(!the_script->internal->rootpw) { + MISSING_ERROR("rootpw") + } + if(the_script->internal->mounts.size() == 0) { + MISSING_ERROR("mount") + } } #undef MISSING_ERROR -- cgit v1.2.3-70-g09d2