forked from rojo-rbx/rojo
Correct issue with default.project.json files with no name being named default after change (#917)
Co-authored-by: Kenneth Loeffler <kenloef@gmail.com>
This commit is contained in:
@@ -63,6 +63,9 @@ pub fn snapshot_from_vfs(
|
||||
if meta.is_dir() {
|
||||
if let Some(init_path) = get_init_path(vfs, path)? {
|
||||
// TODO: support user-defined init paths
|
||||
// If and when we do, make sure to go support it in
|
||||
// `Project::set_file_name`, as right now it special-cases
|
||||
// `default.project.json` as an `init` path.
|
||||
for rule in default_sync_rules() {
|
||||
if rule.matches(&init_path) {
|
||||
return match rule.middleware {
|
||||
@@ -274,7 +277,7 @@ macro_rules! sync_rule {
|
||||
/// Defines the 'default' syncing rules that Rojo uses.
|
||||
/// These do not broadly overlap, but the order matters for some in the case of
|
||||
/// e.g. JSON models.
|
||||
fn default_sync_rules() -> &'static [SyncRule] {
|
||||
pub fn default_sync_rules() -> &'static [SyncRule] {
|
||||
static DEFAULT_SYNC_RULES: OnceLock<Vec<SyncRule>> = OnceLock::new();
|
||||
|
||||
DEFAULT_SYNC_RULES.get_or_init(|| {
|
||||
|
||||
Reference in New Issue
Block a user