KNOWLEDGE BASE
Log In    |    Knowledge Base    |    4D Home
Tech Tip: Build4D Component: "_checkDestinationFolder" function in deletes folder contents
PRODUCT: 4D | VERSION: 20 | PLATFORM: Mac & Win
Published On: April 2, 2024

On top of the Build Application dialog and related 4D commands, the Build4D component provides another avenue to go about building your 4D applications. The component is advantageous in that it helps streamline the build application process and also allows for continuous integration (CI).

When using this component, there is one thing to look out for before executing the process. The _checkDestinationFolder function under the _core class first checks if the set destination folder exists on the diskā€”this is where the built application will be placed after the build process is done. However, this function will also delete the entire contents of the folder before returning true; this is so that there are no file conflicts during the build.

It is important that when setting the path to a destination folder to avoid using a folder that already has contents inside it. Once those files have been deleted by the component, there is no way to retrieve them back. Instead, it is recommended to create a new folder on the disk that will be dedicated to holding the built application files and setting the destination path to this folder.

For reference, here is the link to the documentation to the _checkDestinationFolder function on GitHub: https://github.com/4d-depot/Build4D/blob/main/Build4D/Documentation/Classes/_core.md#function-_checkdestinationfolder.