From 6be6441817cdd52fad6be034d2084af5aee82ea2 Mon Sep 17 00:00:00 2001
From: Alan Nelson <alan.nelson@nebraska.edu>
Date: Wed, 6 Feb 2019 17:16:26 -0600
Subject: [PATCH] Catch the exception when no XML files are found to lint

---
 magento2-xml-lint/latest/xml-lint | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/magento2-xml-lint/latest/xml-lint b/magento2-xml-lint/latest/xml-lint
index 5e5b32a..4d00d97 100644
--- a/magento2-xml-lint/latest/xml-lint
+++ b/magento2-xml-lint/latest/xml-lint
@@ -17,7 +17,11 @@ def get_mappings(misc_file, base_dir):
     return mapping
 
 def get_xml_files(search_dir):
-    return check_output(['find', search_dir, '-name', '*.xml']).splitlines()
+    try:
+        return check_output(['find', search_dir, '-name', '*.xml']).splitlines()
+    except CalledProcessError:
+        print "WARNING: No XML files found"
+        return []
 
 def lint_only(file):
     try:
-- 
GitLab