mirror of
https://github.com/rojo-rbx/rojo.git
synced 2026-10-22 13:21:38 +00:00
Normalize line endings to LF in Lua middleware (#854)
This commit is contained in:
parent
5c4260f3ac
commit
cf25eb0833
5 changed files with 54 additions and 11 deletions
|
|
@ -1,6 +1,5 @@
|
|||
use std::{path::Path, str};
|
||||
|
||||
use anyhow::Context;
|
||||
use maplit::hashmap;
|
||||
use memofs::{IoResultExt, Vfs};
|
||||
|
||||
|
|
@ -14,10 +13,8 @@ pub fn snapshot_txt(
|
|||
path: &Path,
|
||||
name: &str,
|
||||
) -> anyhow::Result<Option<InstanceSnapshot>> {
|
||||
let contents = vfs.read(path)?;
|
||||
let contents_str = str::from_utf8(&contents)
|
||||
.with_context(|| format!("File was not valid UTF-8: {}", path.display()))?
|
||||
.to_owned();
|
||||
let contents = vfs.read_to_string(path)?;
|
||||
let contents_str = contents.as_str();
|
||||
|
||||
let properties = hashmap! {
|
||||
"Value".to_owned() => contents_str.into(),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue