static void
executeEditorCommand(lua_State* L, const char* name, const char* data)
{
	if (lua_getglobal(L, "API_plugin_loader") == LUA_TLIGHTUSERDATA)
	{
		auto loader = (EditorPluginLoader*)lua_touserdata(L, -1);
		auto& editor = loader->getMainWindow().getWorldEditor();
		auto& engine = editor.getEngine();
		auto* command = editor.createEditorCommand(Lumix::crc32(name));
		if (command)
		{
			Lumix::FS::IFile* file = engine.getFileSystem().open(
				engine.getFileSystem().getMemoryDevice(),
				"",
				Lumix::FS::Mode::WRITE);
			ASSERT(file);
			file->write(data, strlen(data));
			file->seek(Lumix::FS::SeekMode::BEGIN, 0);
			Lumix::JsonSerializer serializer(
				*file, Lumix::JsonSerializer::READ, "", engine.getAllocator());
			command->deserialize(serializer);
			editor.executeCommand(command);
			engine.getFileSystem().close(*file);
		}
	}
	lua_pop(L, 1);
}