tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

get_resource_dir.py (758B)


      1 #!/usr/bin/env python3
      2 # Copyright 2025 The Chromium Authors
      3 # Use of this source code is governed by a BSD-style license that can be
      4 # found in the LICENSE file.
      5 """Script to get Clang's resource dir from `cros_target_cc`."""
      6 
      7 import argparse
      8 import subprocess
      9 import sys
     10 from typing import List
     11 
     12 
     13 def main(argv: List[str]) -> None:
     14  parser = argparse.ArgumentParser(
     15      description=__doc__,
     16      formatter_class=argparse.RawDescriptionHelpFormatter,
     17  )
     18  parser.add_argument("cros_target_cc", help="The value of 'cros_target_cc'.")
     19  opts = parser.parse_args(argv)
     20 
     21  sys.exit(
     22      subprocess.run(
     23          (opts.cros_target_cc, "--print-resource-dir"),
     24          check=False,
     25      ).returncode)
     26 
     27 
     28 if __name__ == "__main__":
     29  main(sys.argv[1:])