File tree Expand file tree Collapse file tree
src/glab_discussion/commands Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -60,6 +60,13 @@ def run(args: argparse.Namespace) -> None:
6060 # 8. Dump mode
6161 tmp = Path (tempfile .gettempdir ())
6262 output_dir = tmp / "glab-discussion" / sanitize_path_part (ctx .hostname ) / f"mr-{ ctx .mr_iid } "
63+ force_full = args .full
64+
65+ if force_full and output_dir .exists ():
66+ import shutil
67+
68+ shutil .rmtree (output_dir )
69+
6370 output_dir .mkdir (parents = True , exist_ok = True )
6471
6572 meta_path = output_dir / ".meta.json"
@@ -72,17 +79,15 @@ def run(args: argparse.Namespace) -> None:
7279 new_files : list [str ] = []
7380 updated_files : list [str ] = []
7481
75- force_full = args .full
76-
7782 for discussion in discussions :
7883 filename = _discussion_filename (discussion , user_cache )
7984 max_ts = discussion .max_timestamp
8085 did = discussion .id
8186
8287 new_meta [did ] = {"max_timestamp" : max_ts , "filename" : filename }
8388
84- # Check if we can skip
85- if not force_full and did in old_meta :
89+ # Check if we can skip (--full always writes since dir was cleared)
90+ if did in old_meta :
8691 old_entry = old_meta [did ]
8792 if old_entry .get ("max_timestamp" ) == max_ts :
8893 continue
You can’t perform that action at this time.
0 commit comments