Skip to content

Commit

Permalink
Merge pull request #540 from ndw/iss-535-returncode
Browse files Browse the repository at this point in the history
Propagate the Saxon return code to the shell
  • Loading branch information
ndw authored Oct 24, 2024
2 parents 70ff370 + 5b62f75 commit 0e30925
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/bin/docbook.py
Original file line number Diff line number Diff line change
Expand Up @@ -579,6 +579,7 @@ def run(self):
if self.catalogs:
args.append("-catalog:" + ";".join(self.catalogs))

rc = 0
jopt = self.config.get("java-options", [])
if self.debug:
print(self._java)
Expand All @@ -592,7 +593,9 @@ def run(self):
print(f"\t{item}")
else:
cmd = [self._java] + jopt + ["-cp", cp] + [self.config["class"]] + args
subprocess.call(cmd)
rc = subprocess.call(cmd)

return rc


if __name__ == "__main__":
Expand All @@ -602,7 +605,7 @@ def run(self):
try:
docbook = JavaClassRunner(sys.argv[1:])
docbook.compute_dependencies()
docbook.run()
sys.exit(docbook.run())
except JavaClassRunnerException as err:
print(str(err))
sys.exit(1)

0 comments on commit 0e30925

Please sign in to comment.