|
10 | 10 | from .integrations.manifest import IntegrationManifest |
11 | 11 |
|
12 | 12 |
|
13 | | -def load_speckit_manifest(project_path: Path, *, version: str) -> IntegrationManifest: |
| 13 | +def load_speckit_manifest( |
| 14 | + project_path: Path, |
| 15 | + *, |
| 16 | + version: str, |
| 17 | + console: Any | None = None, |
| 18 | +) -> IntegrationManifest: |
14 | 19 | """Load the shared infrastructure manifest, preserving existing entries.""" |
15 | 20 | manifest_path = project_path / ".specify" / "integrations" / "speckit.manifest.json" |
16 | 21 | if manifest_path.exists(): |
17 | 22 | try: |
18 | 23 | manifest = IntegrationManifest.load("speckit", project_path) |
19 | 24 | manifest.version = version |
20 | 25 | return manifest |
21 | | - except (ValueError, FileNotFoundError): |
22 | | - pass |
| 26 | + except (ValueError, FileNotFoundError) as exc: |
| 27 | + if console is not None: |
| 28 | + console.print( |
| 29 | + f"[yellow]Warning:[/yellow] Could not read shared infrastructure " |
| 30 | + f"manifest at {manifest_path}: {exc}" |
| 31 | + ) |
| 32 | + console.print( |
| 33 | + "A new shared manifest will be created; previously tracked " |
| 34 | + "shared files may be treated as untracked." |
| 35 | + ) |
23 | 36 | return IntegrationManifest("speckit", project_path, version=version) |
24 | 37 |
|
25 | 38 |
|
@@ -60,7 +73,7 @@ def refresh_shared_templates( |
60 | 73 | if not templates_src.is_dir(): |
61 | 74 | return |
62 | 75 |
|
63 | | - manifest = load_speckit_manifest(project_path, version=version) |
| 76 | + manifest = load_speckit_manifest(project_path, version=version, console=console) |
64 | 77 | tracked_files = manifest.files |
65 | 78 | modified = set(manifest.check_modified()) |
66 | 79 | skipped_files: list[str] = [] |
@@ -105,7 +118,7 @@ def install_shared_infra( |
105 | 118 | invoke_separator: str = ".", |
106 | 119 | ) -> bool: |
107 | 120 | """Install shared scripts and templates into *project_path*.""" |
108 | | - manifest = load_speckit_manifest(project_path, version=version) |
| 121 | + manifest = load_speckit_manifest(project_path, version=version, console=console) |
109 | 122 | skipped_files: list[str] = [] |
110 | 123 |
|
111 | 124 | scripts_src = shared_scripts_source(core_pack=core_pack, repo_root=repo_root) |
|
0 commit comments