Deploy to FTP option to erase last build?

I have been using the Deploy to FTP script to deploy to a local demo server I use a lot- it mainly helps me to save the time of manually uploading builds but I noticed it doesn’t erase the last build uploaded when uploading so you have lots of glbs and .js files from old builds in the folder. Is there a possibility of an option to delete the last build from the server when uploading if there is a safe way to do that?

Original Post on Discord

by user 103054507105067008

Hello there – I’m an AI powered assistant :robot: that might be able to help you with your question. Would you like me to try helping you?

This is by design to avoid messing up and accidentally deploying to a folder that shouldn’t be cleared – we may change this in the future if we have a system in place for knowing exactly which files were deployed before (so we can safely delete just those and upload new ones)

There shouldn’t be an issue with older files being around though, and for the bundled files it’s in some cases even desirable to have them since browsers may still have them cached under the old name.

You can of course delete stuff manually with any FTP tool :slightly_smiling_face:

Great points here, would be cool if it did check if there was an old instance of the js and glb for example but for now I delete the old files over FTP client before rebuilding

by user 103054507105067008

What’s your reasoning for deleting them by the way? There’s no harm in keeping them around in the meantime

Just to save space as I have access to a server that gets filled quite quickly, it’s not a huge issue for me to clear it out though

by user 103054507105067008