| 1 | # Copyright (c) Meta Platforms, Inc. and affiliates. |
| 2 | # All rights reserved. |
| 3 | # |
| 4 | # This source code is licensed under the terms described in the LICENSE file in |
| 5 | # the root directory of this source tree. |
| 6 | |
| 7 | import os |
| 8 | |
| 9 | DIR = os.path.dirname(os.path.realpath(__file__)) |
| 10 | CODE_ENV_PREFIX_FILE = os.path.join(DIR, "code_env_prefix.py") |
| 11 | CODE_ENV_PREFIX = None |
| 12 | |
| 13 | |
| 14 | def get_code_env_prefix() -> str: |
| 15 | global CODE_ENV_PREFIX |
| 16 | |
| 17 | if CODE_ENV_PREFIX is None: |
| 18 | with open(CODE_ENV_PREFIX_FILE, "r") as f: |
| 19 | CODE_ENV_PREFIX = f.read() |
| 20 | |
| 21 | return CODE_ENV_PREFIX |