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