mirror of
https://github.com/github/codeql.git
synced 2025-12-16 16:53:25 +01:00
This switched `codegen` from the `autopep8` formatting to the `black` one, and applies it to `bulk_mad_generator.py` as well. We can enroll more python scripts to it in the future.
22 lines
564 B
Python
22 lines
564 B
Python
"""module providing useful filesystem paths"""
|
|
|
|
import pathlib
|
|
import sys
|
|
import os
|
|
|
|
_this_file = pathlib.Path(__file__).resolve()
|
|
|
|
try:
|
|
workspace_dir = pathlib.Path(
|
|
os.environ["BUILD_WORKSPACE_DIRECTORY"]
|
|
).resolve() # <- means we are using bazel run
|
|
root_dir = workspace_dir / "swift"
|
|
except KeyError:
|
|
root_dir = _this_file.parents[2]
|
|
workspace_dir = root_dir.parent
|
|
|
|
lib_dir = _this_file.parents[2] / "codegen" / "lib"
|
|
templates_dir = _this_file.parents[2] / "codegen" / "templates"
|
|
|
|
exe_file = pathlib.Path(sys.argv[0]).resolve()
|