test cases/common/271 env in generator.process/generate_main.py
raw| 1 | #!/usr/bin/env python3 |
| 2 | import os |
| 3 | import sys |
| 4 | |
| 5 | ENV_VAR_VALUE = os.environ.get('ENV_VAR_VALUE') |
| 6 | assert ENV_VAR_VALUE is not None |
| 7 | |
| 8 | with open(sys.argv[1], 'r', encoding='utf-8') as infile, \ |
| 9 | open(sys.argv[2], 'w', encoding='utf-8') as outfile: |
| 10 | |
| 11 | outfile.write(infile.read().replace('ENV_VAR_VALUE', ENV_VAR_VALUE)) |