run_buildkit_cli.py 756 B

1234567891011121314151617181920212223
  1. #!/usr/bin/env python3
  2. # Copyright (c) 2018 The ungoogled-chromium Authors. All rights reserved.
  3. # Use of this source code is governed by a BSD-style license that can be
  4. # found in the LICENSE file.
  5. """
  6. A "current working directory"-independent script to launch the buildkit CLI.
  7. This is an alternative to using "python3 -m buildkit" after ensuring
  8. that buildkit (the directory, which is also also a Python module) is in
  9. a location accessible by the Python import system (e.g. by being in
  10. the containing directory or adding the containing directory to PYTHONPATH)
  11. """
  12. import sys
  13. from pathlib import Path
  14. sys.path.insert(0, str(Path(__file__).resolve().parent.parent))
  15. from buildkit import cli
  16. sys.path.pop(0)
  17. if __name__ == '__main__':
  18. cli.main()