Correct issue with default.project.json files with no name being named default after change (#917)

Co-authored-by: Kenneth Loeffler <kenloef@gmail.com>
This commit is contained in:
Micah
2024-07-15 09:24:51 -07:00
committed by GitHub
parent 7e2bab921a
commit 3ca975d81d
13 changed files with 244 additions and 76 deletions

View File

@@ -22,9 +22,12 @@ pub fn snapshot_project(
path: &Path,
name: &str,
) -> anyhow::Result<Option<InstanceSnapshot>> {
let project = Project::load_from_slice(&vfs.read(path)?, path)
let project = Project::load_exact(vfs, path, Some(name))
.with_context(|| format!("File was not a valid Rojo project: {}", path.display()))?;
let project_name = project.name.as_deref().unwrap_or(name);
let project_name = match project.name.as_deref() {
Some(name) => name,
None => panic!("Project is missing a name"),
};
let mut context = context.clone();
context.clear_sync_rules();