()
| 262 | |
| 263 | |
| 264 | def init(): |
| 265 | global EM_CONFIG |
| 266 | EM_CONFIG = find_config_file() |
| 267 | |
| 268 | # We used to support inline EM_CONFIG. |
| 269 | if '\n' in EM_CONFIG: |
| 270 | exit_with_error('inline EM_CONFIG data no longer supported. Please use a config file.') |
| 271 | |
| 272 | EM_CONFIG = os.path.expanduser(EM_CONFIG) |
| 273 | |
| 274 | # This command line flag needs to work even in the absence of a config |
| 275 | # file, so we must process it here at script import time (otherwise |
| 276 | # the error below will trigger). |
| 277 | if '--generate-config' in sys.argv: |
| 278 | generate_config(EM_CONFIG) |
| 279 | sys.exit(0) |
| 280 | |
| 281 | if os.path.isfile(EM_CONFIG): |
| 282 | logger.debug(f'using config file: {EM_CONFIG}') |
| 283 | else: |
| 284 | logger.debug('config file not found; using default config') |
| 285 | |
| 286 | # Emscripten compiler spawns other processes, which can reimport shared.py, so |
| 287 | # make sure that those child processes get the same configuration file by |
| 288 | # setting it to the currently active environment. |
| 289 | os.environ['EM_CONFIG'] = EM_CONFIG |
| 290 | |
| 291 | read_config() |
| 292 | |
| 293 | |
| 294 | init() |
no test coverage detected