Fix use of services as partition targets

This commit is contained in:
Lucien Greathouse
2017-12-07 16:56:20 -08:00
parent 9fd6799f93
commit 23d4f45ac9
2 changed files with 11 additions and 3 deletions

View File

@@ -1,9 +1,12 @@
# Rojo Change Log
## Current Master
* Fixed using a service as the target of a partition (part of #11)
* There are still cases that will trigger errors, like putting an `init.lua` file inside of a service.
* **Note that the contents of the service will be synced with the filesystem, so any existing items will be deleted!**
* Fixed server when using a file as a partition
* Previously, trailing slashes were put on the end of a partition even if the read request was an empty string. This broke file reading on Windows when a partition pointed to a file instead of a directory!
* Started running automatic tests on Travis CI
* Started running automatic tests on Travis CI (#9)
* This is only for the server right now
* Soon, I'll upgrade [Lemur](http://github.com/LPGhatguy/Lemur) to have APIs necessary for testing plugins and start testing the plugion portion of Rojo as well.

View File

@@ -171,8 +171,13 @@ function Reconciler.reconcile(rbx, item, fileName, parent)
end
else
if rbx.ClassName ~= "Folder" then
rbx:Destroy()
return Reconciler._reify(item, fileName, parent)
-- Certain objects (services) can't be destroyed.
-- If we target one of these, leave it alone!
local ok = pcall(rbx.Destroy, rbx)
if ok then
return Reconciler._reify(item, fileName, parent)
end
end
end