mirror of
https://github.com/rojo-rbx/rojo.git
synced 2026-10-23 14:01:37 +00:00
Enhance PatchSet data model update handling and update default project path in CLI
- Improved the `removeDataModelName` function in PatchSet to remove names from both `changedName` and `changedProperties`, ensuring more robust update management. - Updated the default project path in the ServeCommand struct to `default.project.json5` for clearer project serving expectations.
This commit is contained in:
parent
77088eccd8
commit
a98d5c6cce
2 changed files with 21 additions and 6 deletions
|
|
@ -407,13 +407,28 @@ function PatchSet.removeDataModelName(patchSet, instanceMap)
|
|||
end
|
||||
|
||||
for i, update in ipairs(patchSet.updated) do
|
||||
if update.id == dataModelId and update.changedName ~= nil then
|
||||
update.changedName = nil
|
||||
if update.id == dataModelId then
|
||||
-- Remove Name from both changedName and changedProperties
|
||||
local hadChanges = false
|
||||
if update.changedName ~= nil then
|
||||
update.changedName = nil
|
||||
hadChanges = true
|
||||
end
|
||||
if update.changedProperties and update.changedProperties.Name ~= nil then
|
||||
update.changedProperties.Name = nil
|
||||
hadChanges = true
|
||||
end
|
||||
|
||||
if not hadChanges then
|
||||
return
|
||||
end
|
||||
|
||||
-- Remove update entirely if no other changes remain
|
||||
if
|
||||
update.changedClassName == nil
|
||||
update.changedName == nil
|
||||
and update.changedClassName == nil
|
||||
and update.changedMetadata == nil
|
||||
and next(update.changedProperties) == nil
|
||||
and (update.changedProperties == nil or next(update.changedProperties) == nil)
|
||||
then
|
||||
table.remove(patchSet.updated, i)
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue