mirror of
https://github.com/zulip/zulip.git
synced 2025-11-10 08:56:10 +00:00
script: Add --no-headings option to purge-old-deployments.
This parameter is somewhat useful, and adding this also fixes a
regression where purge-old-deployments would crash since the changes
around c5580607a7 because of
inconsistent supported args lists.
This commit is contained in:
@@ -31,13 +31,14 @@ def remove_unused_versions_dir(args: argparse.Namespace) -> None:
|
|||||||
except FileNotFoundError:
|
except FileNotFoundError:
|
||||||
return
|
return
|
||||||
|
|
||||||
|
no_headings = getattr(args, "no_headings", False)
|
||||||
may_be_perform_purging(
|
may_be_perform_purging(
|
||||||
dirs_to_purge,
|
dirs_to_purge,
|
||||||
{current_version_dir},
|
{current_version_dir},
|
||||||
"yarn cache",
|
"yarn cache",
|
||||||
args.dry_run,
|
args.dry_run,
|
||||||
args.verbose,
|
args.verbose,
|
||||||
args.no_headings,
|
no_headings,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -43,6 +43,13 @@ def parse_args() -> argparse.Namespace:
|
|||||||
action="store_true",
|
action="store_true",
|
||||||
help="If specified then script will print a detailed report of what is going on.",
|
help="If specified then script will print a detailed report of what is going on.",
|
||||||
)
|
)
|
||||||
|
parser.add_argument(
|
||||||
|
"--no-print-headings",
|
||||||
|
dest="no_headings",
|
||||||
|
action="store_true",
|
||||||
|
help="If specified then script will not print headings for "
|
||||||
|
"what will be deleted/kept back.",
|
||||||
|
)
|
||||||
|
|
||||||
args = parser.parse_args()
|
args = parser.parse_args()
|
||||||
args.verbose |= args.dry_run # Always print a detailed report in case of dry run.
|
args.verbose |= args.dry_run # Always print a detailed report in case of dry run.
|
||||||
@@ -83,6 +90,7 @@ def main() -> None:
|
|||||||
["git", "worktree", "prune"], cwd=LOCAL_GIT_CACHE_DIR, preexec_fn=su_to_zulip
|
["git", "worktree", "prune"], cwd=LOCAL_GIT_CACHE_DIR, preexec_fn=su_to_zulip
|
||||||
)
|
)
|
||||||
|
|
||||||
|
if not args.no_headings:
|
||||||
print("Deployments cleaned successfully...")
|
print("Deployments cleaned successfully...")
|
||||||
print("Cleaning orphaned/unused caches...")
|
print("Cleaning orphaned/unused caches...")
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user