Implement Syncback to support converting Roblox files to a Rojo project (#937)

This is a very large commit.
Consider checking the linked PR for more information.
This commit is contained in:
Micah
2025-11-19 09:21:33 -08:00
committed by GitHub
parent 071b6e7e23
commit 9b5a07191b
239 changed files with 5325 additions and 225 deletions

View File

@@ -16,6 +16,7 @@ pub fn match_trailing<'a>(input: &'a str, suffix: &str) -> Option<&'a str> {
pub trait PathExt {
fn file_name_ends_with(&self, suffix: &str) -> bool;
fn file_name_trim_end<'a>(&'a self, suffix: &str) -> anyhow::Result<&'a str>;
fn parent_err(&self) -> anyhow::Result<&Path>;
}
impl<P> PathExt for P
@@ -40,6 +41,12 @@ where
match_trailing(file_name, suffix)
.with_context(|| format!("Path did not end in {}: {}", suffix, path.display()))
}
fn parent_err(&self) -> anyhow::Result<&Path> {
let path = self.as_ref();
path.parent()
.with_context(|| format!("Path does not have a parent: {}", path.display()))
}
}
// TEMP function until rojo 8.0, when it can be replaced with bool::default (aka false)