rojo icon indicating copy to clipboard operation
rojo copied to clipboard

Prevent building model as a place and vice versa

Open Dekkonot opened this issue 2 years ago • 1 comments

Currently, we trust the user to choose their own extension when building. However, this allows mistakes because people can build models as place files or vice versa.

Given that this should be as easy as checking whether the root of a file is a DataModel, it should be trivial to check whether the correct type of file is being built for the specified extension. We should probably do that.

Dekkonot avatar Jul 14 '23 20:07 Dekkonot

We have protections for syncing a model into a place on the Studio plugin side, but honestly we should probably warn/forbid serving a model in the first place since there's no context in which that makes sense as far as I'm aware.

I think a PR for this should cover build and sync, since it'd be more or less the same line of code in both places.

boatbomber avatar Jul 15 '23 02:07 boatbomber