{"record":{"id":"0c55e4b494782aa7","repo":"CoplayDev/unity-mcp","slug":"source-mcpforunity-folder-not-found-source-mcp","errorCode":null,"errorMessage":"Source MCPForUnity folder not found: {source_mcp}","messagePattern":"Source MCPForUnity folder not found: (.+?)","errorType":"exception","errorClass":"RuntimeError","httpStatus":null,"severity":"error","filePath":"tools/prepare_unity_asset_store_release.py","lineNumber":110,"sourceCode":"        help=\"Backup existing Assets/MCPForUnity before replacing.\",\n    )\n    parser.add_argument(\n        \"--dry-run\",\n        action=\"store_true\",\n        help=\"Only validate that operations would succeed; do not write/copy/delete.\",\n    )\n    args = parser.parse_args()\n\n    repo_root = Path(args.repo_root).expanduser().resolve()\n    asset_project = Path(args.asset_project).expanduser().resolve(\n    ) if args.asset_project else (repo_root / \"TestProjects\" / \"AssetStoreUploads\")\n    remote_url = args.remote_url.strip()\n    if not remote_url:\n        raise RuntimeError(\"--remote-url must be a non-empty URL\")\n\n    source_mcp = repo_root / \"MCPForUnity\"\n    if not source_mcp.is_dir():\n        raise RuntimeError(\n            f\"Source MCPForUnity folder not found: {source_mcp}\")\n\n    assets_dir = asset_project / \"Assets\"\n    if not assets_dir.is_dir():\n        raise RuntimeError(f\"Assets folder not found: {assets_dir}\")\n\n    dest_mcp = assets_dir / \"MCPForUnity\"\n\n    if args.dry_run:\n        print(\"[dry-run] Validated paths. No changes applied.\")\n        print(\"[dry-run] Would stage a temporary copy of MCPForUnity and apply Asset Store edits there.\")\n        print(\n            f\"[dry-run] Would replace:\\n- {dest_mcp}\\n  with\\n- {source_mcp}\")\n        return 0\n\n    # 1) Stage a temporary copy of MCPForUnity and apply Asset Store-specific edits there.\n    with tempfile.TemporaryDirectory(prefix=\"mcpforunity_assetstore_\") as tmpdir:\n        staged_mcp = Path(tmpdir) / \"MCPForUnity\"","sourceCodeStart":92,"sourceCodeEnd":128,"githubUrl":"https://github.com/CoplayDev/unity-mcp/blob/c21bf496bca87d54e75bad048563c3adb1782081/tools/prepare_unity_asset_store_release.py#L92-L128","documentation":"Raised when repo_root / 'MCPForUnity' is not a directory. The script copies this folder as the source for Asset Store packaging, so its absence is fatal. repo_root defaults to the script's parent-of-parent but can be overridden with --repo-root.","triggerScenarios":"Running the script with --repo-root pointing at the wrong location; running from a shallow/partial clone that lacks the MCPForUnity directory; the directory was renamed or relocated in a repo restructure.","commonSituations":"Wrong working directory; the script was copied outside the repo tree so REPO_ROOT_DEFAULT resolves incorrectly; a fresh checkout that didn't fetch submodules or LFS-tracked content (though MCPForUnity is a plain directory, not a submodule).","solutions":["Verify the MCPForUnity directory exists: ls <repo_root>/MCPForUnity.","Pass --repo-root explicitly pointing at the actual repo root containing MCPForUnity/.","If the directory was renamed, update the constant or the --repo-root argument to match."],"exampleFix":"# before\npython tools/prepare_unity_asset_store_release.py --repo-root /wrong/path --remote-url https://...\n\n# after\npython tools/prepare_unity_asset_store_release.py --repo-root /path/to/unity-mcp --remote-url https://...","handlingStrategy":"validation","validationCode":"from pathlib import Path\n\nrepo_root = Path(\".\").resolve()\nsource_mcp = repo_root / \"MCPForUnity\"\nif not source_mcp.is_dir():\n    raise SystemExit(f\"MCPForUnity not found at {source_mcp}. Check --repo-root.\")","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always run release scripts from the repo root or pass --repo-root explicitly.","Add a pre-flight assertion at the top of CI jobs that verifies the expected directory layout."],"tags":["build-script","release-tooling","path-validation","filesystem"],"backgroundTag":null,"analyzedSha":"c21bf496bca87d54e75bad048563c3adb1782081","analyzedAt":"2026-08-13T17:36:56.095Z","schemaVersion":2},"datasetVersion":"2026-08-13T19:17:28.613Z"}