diff options
author | A. Wilcox <AWilcox@Wilcox-Tech.com> | 2019-10-12 02:35:52 -0500 |
---|---|---|
committer | A. Wilcox <AWilcox@Wilcox-Tech.com> | 2019-10-12 02:35:52 -0500 |
commit | bd16fe70f9ffbf0bb6ae7cfd763554559f708a02 (patch) | |
tree | 7e5b04679f71adb68d29d049a54858571a4f6fe6 | |
parent | 717ace2e5f9f7c19c00fca5732c13d38d97e342d (diff) | |
download | horizon-bd16fe70f9ffbf0bb6ae7cfd763554559f708a02.tar.gz horizon-bd16fe70f9ffbf0bb6ae7cfd763554559f708a02.tar.bz2 horizon-bd16fe70f9ffbf0bb6ae7cfd763554559f708a02.tar.xz horizon-bd16fe70f9ffbf0bb6ae7cfd763554559f708a02.zip |
hscript: Only print MISSING_ERRORS if no other errors occurred
-rw-r--r-- | hscript/script.cc | 30 |
1 files changed, 16 insertions, 14 deletions
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 |