copier icon indicating copy to clipboard operation
copier copied to clipboard

Support for .copierignore file similar to .gitignore

Open entelecheia opened this issue 1 year ago • 18 comments

Is your feature request related to a problem? Please describe. I'm finding it cumbersome to handle the exclusion of certain files and directories when using Copier. Currently, there's no built-in support for an ignore file like .gitignore, which makes it difficult to manage a list of files or directories to be skipped during the copying process.

Describe the solution you'd like I'd like to have a .copierignore file that works similarly to a .gitignore file. This file should allow users to list files and directories that should be excluded from the copying process. Copier should automatically recognize the .copierignore file and exclude the specified files and directories without the need for additional command line arguments.

Describe alternatives you've considered As a workaround, I have been using a bash script to read a .copierignore file and pass the files to Copier as --skip arguments:

@bash -c 'args=(); while IFS= read -r file; do args+=("--skip" "$$file"); done < .copierignore; copier "$${args[@]}" --answers-file .copier-config.yaml gh:entelecheia/hyperfast-python-template .'

However, this solution is not ideal, as it requires extra manual effort and may not be as intuitive for users unfamiliar with bash scripting.

Additional context Having a built-in solution for ignoring files and directories would streamline the copying process and improve the user experience. This feature would be particularly useful for projects with numerous files or directories that need to be excluded, allowing users to easily manage their exclusion lists.

entelecheia avatar May 05 '23 22:05 entelecheia