mirror of
https://github.com/rojo-rbx/rojo.git
synced 2026-04-20 20:55:50 +00:00
Load project file from VFS instead of through fs.
Fixes #320. Previously, the root project file was loaded via methods on Project (which do not know about the VFS) instead of through the VFS like all other disk access. This meant that Rojo was unable to build its own plugin because there is no project file on the real disk, only in the VFS.
This commit is contained in:
@@ -111,8 +111,13 @@ impl Project {
|
||||
pub fn load_from_slice(
|
||||
contents: &[u8],
|
||||
project_file_location: &Path,
|
||||
) -> Result<Self, serde_json::Error> {
|
||||
let mut project: Self = serde_json::from_slice(&contents)?;
|
||||
) -> Result<Self, ProjectError> {
|
||||
let mut project: Self =
|
||||
serde_json::from_slice(&contents).map_err(|source| Error::Json {
|
||||
source,
|
||||
path: project_file_location.to_owned(),
|
||||
})?;
|
||||
|
||||
project.file_location = project_file_location.to_path_buf();
|
||||
project.check_compatibility();
|
||||
Ok(project)
|
||||
|
||||
Reference in New Issue
Block a user