From 39f2889cf7b88f0815726e4d9015074354950844 Mon Sep 17 00:00:00 2001 From: Dunedan Date: Sun, 25 Aug 2024 17:07:55 +0200 Subject: [PATCH] Support calling checkrefs.py from other dirs --- build/jenkins/pipelines/checkrefs.Jenkinsfile | 2 +- source/tools/entity/checkrefs.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/build/jenkins/pipelines/checkrefs.Jenkinsfile b/build/jenkins/pipelines/checkrefs.Jenkinsfile index 41072e8b08..5e9f7262b2 100644 --- a/build/jenkins/pipelines/checkrefs.Jenkinsfile +++ b/build/jenkins/pipelines/checkrefs.Jenkinsfile @@ -38,7 +38,7 @@ pipeline { stage("Data checks") { steps { - sh "cd source/tools/entity/ && python3 checkrefs.py -tax" + sh "python3 source/tools/entity/checkrefs.py -tax" } } } diff --git a/source/tools/entity/checkrefs.py b/source/tools/entity/checkrefs.py index 37ac8000c2..45d42fdd22 100755 --- a/source/tools/entity/checkrefs.py +++ b/source/tools/entity/checkrefs.py @@ -131,14 +131,14 @@ class CheckRefs: if args.check_unused: self.check_unused() if args.validate_templates: - sys.path.append("../xmlvalidator/") + sys.path.append(str(Path(__file__).parent.parent / "xmlvalidator")) from validate_grammar import RelaxNGValidator validate = RelaxNGValidator(self.vfs_root, self.mods) if not validate.run(): self.inError = True if args.validate_actors: - sys.path.append("../xmlvalidator/") + sys.path.append(str(Path(__file__).parent.parent / "xmlvalidator")) from validator import Validator validator = Validator(self.vfs_root, self.mods)