|
10 | 10 | from rich.console import Console |
11 | 11 | from rich.table import Table |
12 | 12 |
|
13 | | -from typing import Callable, Optional, cast, Any |
| 13 | +from typing import Callable, Optional, Any |
14 | 14 |
|
15 | 15 | from datamanager.config import settings |
16 | 16 | from datamanager import core, manifest |
|
27 | 27 | ) |
28 | 28 |
|
29 | 29 |
|
30 | | -# Git helpers |
31 | | -def _stage_all() -> None: |
32 | | - """Stage every working-tree change.""" |
33 | | - subprocess.run(["git", "add", "-A"], check=True) |
34 | | - |
35 | | - |
36 | | -def _build_detached_commit(message: str) -> str: |
37 | | - """ |
38 | | - Create a commit object from the **current index** without |
39 | | - moving HEAD. Returns the full commit SHA. |
40 | | - """ |
41 | | - tree = subprocess.check_output(["git", "write-tree"], text=True).strip() |
42 | | - parent = subprocess.check_output(["git", "rev-parse", "HEAD"], text=True).strip() |
43 | | - sha = subprocess.check_output( |
44 | | - ["git", "commit-tree", tree, "-p", parent, "-m", message], |
45 | | - text=True, |
46 | | - ).strip() |
47 | | - return sha |
48 | | - |
49 | | - |
50 | | -# Prompt helpers |
51 | | -def _ask_text(ctx: typer.Context, prompt: str, default: str) -> str: |
52 | | - if ctx.obj.get("no_prompt"): # ← global flag |
53 | | - console.print(f"[cyan]--yes[/] given – using default message: '{default}'") |
54 | | - return default |
55 | | - result: Optional[str] = questionary.text(prompt, default=default).ask() |
56 | | - return cast(str, result) |
57 | | - |
58 | | - |
59 | 30 | def _ask_confirm(ctx: typer.Context, prompt: str, default: bool = False) -> bool: |
60 | 31 | if ctx.obj.get("no_prompt"): |
61 | 32 | return True |
@@ -321,7 +292,7 @@ def _run_prepare_logic(ctx: typer.Context, name: str, file: Path) -> None: |
321 | 292 | manifest.add_history_entry(name, new_entry) |
322 | 293 |
|
323 | 294 | else: |
324 | | - # --- This is for CREATE |
| 295 | + # --- This is for CREATE --- |
325 | 296 | new_dataset_obj = { |
326 | 297 | "fileName": name, |
327 | 298 | "latestVersion": "v1", |
|
0 commit comments