forked from rojo-rbx/rojo
Port Project snapshot to use with_not_found
This commit is contained in:
@@ -4,7 +4,7 @@ use rbx_dom_weak::{RbxId, RbxTree};
|
|||||||
use rbx_reflection::try_resolve_value;
|
use rbx_reflection::try_resolve_value;
|
||||||
|
|
||||||
use crate::{
|
use crate::{
|
||||||
imfs::{FsErrorKind, Imfs, ImfsEntry, ImfsFetcher},
|
imfs::{FsResultExt, Imfs, ImfsEntry, ImfsFetcher},
|
||||||
project::{Project, ProjectNode},
|
project::{Project, ProjectNode},
|
||||||
snapshot::{InstanceMetadata, InstanceSnapshot, InstigatingSource},
|
snapshot::{InstanceMetadata, InstanceSnapshot, InstigatingSource},
|
||||||
};
|
};
|
||||||
@@ -27,14 +27,12 @@ impl SnapshotMiddleware for SnapshotProject {
|
|||||||
if entry.is_directory() {
|
if entry.is_directory() {
|
||||||
let project_path = entry.path().join("default.project.json");
|
let project_path = entry.path().join("default.project.json");
|
||||||
|
|
||||||
match imfs.get(project_path) {
|
match imfs.get(project_path).with_not_found()? {
|
||||||
Err(ref err) if err.kind() == FsErrorKind::NotFound => {}
|
|
||||||
Err(err) => return Err(err.into()),
|
|
||||||
|
|
||||||
// TODO: Do we need to muck with the relevant paths if we're a
|
// TODO: Do we need to muck with the relevant paths if we're a
|
||||||
// project file within a folder? Should the folder path be the
|
// project file within a folder? Should the folder path be the
|
||||||
// relevant path instead of the project file path?
|
// relevant path instead of the project file path?
|
||||||
Ok(entry) => return SnapshotProject::from_imfs(imfs, &entry),
|
Some(entry) => return SnapshotProject::from_imfs(imfs, &entry),
|
||||||
|
None => return Ok(None),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user