MCPcopy Create free account
hub / github.com/bigdra50/unity-cli / is_unity_project

Function is_unity_project

unity_cli/hub/project.py:71–92  ·  view source on GitHub ↗

Check if path is a valid Unity project. A valid Unity project contains: - Assets/ directory - ProjectSettings/ directory - ProjectSettings/ProjectVersion.txt file

(path: Path)

Source from the content-addressed store, hash-verified

69
70
71def is_unity_project(path: Path) -> bool:
72 """Check if path is a valid Unity project.
73
74 A valid Unity project contains:
75 - Assets/ directory
76 - ProjectSettings/ directory
77 - ProjectSettings/ProjectVersion.txt file
78 """
79 if not path.is_dir():
80 return False
81
82 assets_dir = path / "Assets"
83 project_settings_dir = path / "ProjectSettings"
84 version_file = project_settings_dir / "ProjectVersion.txt"
85
86 return (
87 assets_dir.exists()
88 and assets_dir.is_dir()
89 and project_settings_dir.exists()
90 and project_settings_dir.is_dir()
91 and version_file.exists()
92 )
93
94
95# =============================================================================

Callers 6

project_packagesFunction · 0.90
project_tagsFunction · 0.90
project_qualityFunction · 0.90
project_assembliesFunction · 0.90
open_projectMethod · 0.90
from_pathMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected