Skip to content

Commit bde3c89

Browse files
committed
Make indepenent of the current working directory
1 parent 14efbac commit bde3c89

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

scripts/release/create_supported_rules_list.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,6 @@
1212
When run without any arguments, the script iterates through each of the rule package description
1313
files stored in the `rule_packages` directory, and identifies which rules are supported by one or
1414
more queries.
15-
16-
This script needs to be run with the codeql-coding-standards git repository as the current working
17-
directory.
1815
"""
1916

2017
if (len(sys.argv) == 2 and sys.argv[1] == "--help"):

scripts/release/utils.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import re
22
import yaml
3+
from pathlib import Path
34

45
def get_query_short_names(rule_dict):
56
"""Gets a list of the query "short_name" properties for the given rule"""
@@ -18,7 +19,9 @@ def split_rule_id(rule_id):
1819

1920
def get_standard_version(standard):
2021
"""Gets the qlpack version for the given standard."""
21-
qlpack_path = "cpp/" + standard.split("-")[0].lower() + "/src/qlpack.yml"
22+
module_path = Path(__file__)
23+
repo_root = module_path.parent.parent.parent
24+
qlpack_path = repo_root / "cpp" / standard.split("-")[0].lower() /"src" / "qlpack.yml"
2225
with open(qlpack_path, 'r') as qlpack_file:
2326
try:
2427
qlpack = yaml.safe_load(qlpack_file)

0 commit comments

Comments
 (0)