mirror of
https://gitea.windcorp.ru/Wind-Corporation/Progressia.git
synced 2025-04-21 12:30:46 +03:00
TMP / pre-commit.py: save settings before complaining
This commit is contained in:
parent
12671e8f69
commit
6f29e43b69
@ -251,10 +251,9 @@ def get_settings_path():
|
||||
SETTINGS_PATH))
|
||||
|
||||
|
||||
def set_build_root():
|
||||
"""Set last build root in tools/pre-commit-settings.json."""
|
||||
path = get_settings_path()
|
||||
verbose(f"Updating {path}")
|
||||
def save_settings():
|
||||
"""Save tools/pre-commit-settings.json."""
|
||||
verbose(f"Saving settings into {path}")
|
||||
if not dry_run:
|
||||
settings['build_root'] = arg_build_root
|
||||
with open(path, mode='w') as f:
|
||||
@ -263,6 +262,12 @@ def set_build_root():
|
||||
verbose(' skipped: --dry-run')
|
||||
|
||||
|
||||
def set_build_root():
|
||||
"""Set last build root in tools/pre-commit-settings.json."""
|
||||
path = get_settings_path()
|
||||
save_settings()
|
||||
|
||||
|
||||
def parse_args():
|
||||
"""Parse sys.argv and environment variables; set corresponding globals.
|
||||
Return (action, argument for set-build-root).
|
||||
@ -337,6 +342,7 @@ def load_settings():
|
||||
"clang_format_diff": None,
|
||||
"parallelism": 1
|
||||
}
|
||||
save_settings()
|
||||
|
||||
build_root = settings['build_root']
|
||||
parallelism = settings['parallelism']
|
||||
|
Loading…
x
Reference in New Issue
Block a user