Remove stateful Runner

This commit is contained in:
Anthony Sottile 2018-12-26 22:33:21 -08:00
parent 1d40cc2104
commit fe409f1a43
17 changed files with 209 additions and 315 deletions

View file

@ -45,15 +45,15 @@ def _migrate_sha_to_rev(contents):
return reg.sub(r'\1rev:', contents)
def migrate_config(runner, quiet=False):
with io.open(runner.config_file_path) as f:
def migrate_config(config_file, quiet=False):
with io.open(config_file) as f:
orig_contents = contents = f.read()
contents = _migrate_map(contents)
contents = _migrate_sha_to_rev(contents)
if contents != orig_contents:
with io.open(runner.config_file_path, 'w') as f:
with io.open(config_file, 'w') as f:
f.write(contents)
print('Configuration has been migrated.')