mirror of
https://github.com/rojo-rbx/rojo.git
synced 2026-10-20 17:41:37 +00:00
Add a new syncRules field project files to allow users to specify middleware to use for files (#813)
This commit is contained in:
parent
c0a96e3811
commit
73828af715
48 changed files with 923 additions and 146 deletions
|
|
@ -9,14 +9,14 @@ use crate::{
|
|||
snapshot::{InstanceContext, InstanceMetadata, InstanceSnapshot},
|
||||
};
|
||||
|
||||
use super::{meta_file::AdjacentMetadata, util::PathExt};
|
||||
use super::meta_file::AdjacentMetadata;
|
||||
|
||||
pub fn snapshot_json(
|
||||
context: &InstanceContext,
|
||||
vfs: &Vfs,
|
||||
path: &Path,
|
||||
name: &str,
|
||||
) -> anyhow::Result<Option<InstanceSnapshot>> {
|
||||
let name = path.file_name_trim_end(".json")?;
|
||||
let contents = vfs.read(path)?;
|
||||
|
||||
let value: serde_json::Value = serde_json::from_slice(&contents)
|
||||
|
|
@ -107,6 +107,7 @@ mod test {
|
|||
&InstanceContext::default(),
|
||||
&mut vfs,
|
||||
Path::new("/foo.json"),
|
||||
"foo",
|
||||
)
|
||||
.unwrap()
|
||||
.unwrap();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue