From c9e9bf7e1cb6e5392b3d9368816f7de60f7c6c21 Mon Sep 17 00:00:00 2001 From: PabstMirror Date: Sat, 30 Mar 2019 17:15:20 -0500 Subject: [PATCH] Allow running from root directory as well as from inside the tools directory --- circle.yml | 2 +- tools/check_strings.py | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/circle.yml b/circle.yml index 8b5116bb13d..5cd5f0d72d7 100644 --- a/circle.yml +++ b/circle.yml @@ -7,7 +7,7 @@ jobs: - checkout - run: name: Validate SQF and Config style and Stringtable entries - command: python tools/check_strings.py && python tools/sqf_validator.py && python tools/config_style_checker.py + command: python tools/sqf_validator.py && python tools/config_style_checker.py && python tools/check_strings.py linting: docker: diff --git a/tools/check_strings.py b/tools/check_strings.py index ca4e700cfb4..78ad52b04e3 100644 --- a/tools/check_strings.py +++ b/tools/check_strings.py @@ -51,7 +51,12 @@ def main(argv): allDefinedStrings = [] allUsedStrings = [] - for root, dirnames, filenames in os.walk('../addons' + '/'): + # Allow running from root directory as well as from inside the tools directory + rootDir = "../addons" + if (os.path.exists("addons")): + rootDir = "addons" + + for root, dirnames, filenames in os.walk(rootDir): for filename in fnmatch.filter(filenames, '*.sqf'): sqf_list.append(os.path.join(root, filename)) for filename in fnmatch.filter(filenames, '*.cpp'):