CopyAndModifyFolder

CopyAndModifyFolder is a Java utility program designed to streamline the process of copying and modifying files and folders from multiple source directories to their respective destination directories. This tool is particularly useful for managing client-side configurations and removing unnecessary files or folders in a Minecraft Forge modding environment. The program reads its configuration from a YAML file, allowing easy customization and automation of the copying and modification process.

Features Customizable Source and Destination Folders: The program allows you to specify multiple source folders, each with its own destination folder. You can set whether to run the program from the 'mods' folder, and adjust the level of the main directory in relation to the current directory.

Use Custom Output Directory: You have the option to use a custom output directory for each source folder. If enabled, each source folder will have its own output directory specified in the configuration.

Global Override Custom Output Directory: Set a global custom output directory to override the default destination folder for all source folders.

Config List: Specify a list of client-side config files to be removed from the copied folder. Files should be specified relative to the destination folder.

Folder List: Provide a list of folders to be deleted from the copied folder. Folders should be specified relative to the destination folder.

Automated Deletions: The program checks for files and folders that should be deleted but were not specified in the configuration file, and automatically removes them.

Logging: Detailed logging with a log file (CopyAndModifyFolder.log) keeps track of copied files, deleted folders, and any potential errors.

Gradle Support: This utility can be integrated into your Gradle project as a build task, making it easy to automate the copying and modification process as part of your development workflow.

Usage Clone or download the repository. Customize the config-server-client-side-files.yaml file to suit your needs. Specify the source folders, destination folders, config list, folder list, and other options as required. Run the program by executing the main method in the CopyAndModifyFolder class. The program will copy the files and folders from the specified source folders to their respective destination folders, remove client-side config files, and delete specified folders. Log files will be generated to keep track of the process. Configuration The config-server-client-side-files.yaml configuration file is structured with various options:

MAIN_DIRECTORY_LEVEL: Set the level of the main directory in relation to the current directory. RUN_FROM_MODS: Set whether to run the program from the 'mods' folder. GLOBAL_OVERRIDE_CUSTOM_OUTPUT_DIR: Set a global custom output directory to override the default destination folder for all source folders. USE_CUSTOM_OUTPUT_DIR: Set whether to use a custom output directory for each source folder. SOURCE_FOLDERS: List of source folders with their respective custom output directories (if enabled). CONFIG_LIST: List of client-side config files to be removed from the copied folder. FOLDER_LIST: List of folders to be deleted from the copied folder. NUM_FOLDERS: (Deprecated) Set the number of folders to clone and paste. Note: This program is designed for Minecraft Forge mod development but can be adapted for other purposes as well. Make sure to adjust the file paths and folder names in the configuration file according to your project's structure.

Feel free to use this utility to enhance your modding workflow and automate the management of client-side configurations! If you encounter any issues or have suggestions for improvements, please feel free to create an issue or contribute to the project. Happy modding! This program is designed for Minecraft Forge mod development but can be adapted for other purposes as well. Make sure to adjust the file paths and folder names in the configuration file according to your project's structure. Feel free to use this utility to enhance your modding workflow and automate the management of client-side configurations! If you encounter any issues or have suggestions for improvements, please feel free to create an issue or contribute to the project. Happy modding!