Skip to content

Commit

Permalink
fix xmllint check in SConscript
Browse files Browse the repository at this point in the history
  • Loading branch information
NQNStudios committed Aug 3, 2024
1 parent f9ccd2b commit 91b846e
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions rsrc/SConscript
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,13 @@ env.Install(path.join(install_dir, "Blades of Exile Base"), Glob("#build/rsrc/ba

have_xmllint = False

nulldev = open(os.devnull, 'w')
if str(platform) == "win32":
have_xmllint = (subprocess.call(['where', '/Q', 'xmllint']) == 0)
else:
check_xmllint = subprocess.run(['which', 'xmllint'], capture_output=True)
have_xmllint = (check_xmllint.returncode == 0 and len(check_xmllint.stdout) != 0)

if ((str(platform) != "win32" and subprocess.call(['which', 'xmllint'], stdout=nulldev, stderr=nulldev) == 0) or
(str(platform) == "win32" and subprocess.call(['where', '/Q', 'xmllint'])) == 0):
have_xmllint = True
if have_xmllint:
xmllint_command = ('xmllint', '--nonet', '--noout', '--schema', '../schemas/dialog.xsd')

if have_xmllint: # This is separate so that alternate xml validators could be used
Expand Down

0 comments on commit 91b846e

Please sign in to comment.