Skip to contents

These functions allow manual addition of files and directories to the .gitignore and .Rbuildignore files, outside of the automatic management provided by the projr package.

  • projr_ignore_manual: General function to add both files and directories to both .gitignore and .Rbuildignore. If a path does not exist, it is treated as a file.

  • projr_ignore_manual_dir: Specifically adds directories to both .gitignore and .Rbuildignore.

  • projr_ignore_manual_file: Specifically adds files to both .gitignore and .Rbuildignore.

  • projr_ignore_manual_dir_git and projr_ignore_manual_file_git: Add directories or files explicitly to .gitignore.

  • projr_ignore_manual_dir_rbuild and projr_ignore_manual_file_rbuild: Add directories or files explicitly to .Rbuildignore.

Usage

projr_ignore_manual(ignore)

projr_ignore_manual_dir(ignore)

projr_ignore_manual_file(ignore)

projr_ignore_manual_file_git(ignore)

projr_ignore_manual_dir_git(ignore)

projr_ignore_manual_file_rbuild(ignore)

projr_ignore_manual_dir_rbuild(ignore)

Arguments

ignore

A character vector of file or directory paths to be ignored. Paths must be valid non-empty strings.

Value

Invisibly returns TRUE if the operation succeeds, or FALSE if the input contains invalid (empty) paths.

Details

These functions provide fine-grained control for cases where users want to manually ignore specific paths permanently. They do not interact with the automated ignore management system of projr.

  • Non-existent paths provided to projr_ignore_manual are assumed to be files.

  • For .gitignore, directories are automatically appended with /** if missing, ensuring proper Git ignore syntax.

  • For .Rbuildignore, paths are converted to regular expressions using glob2rx for compatibility with R's build tools.

See also

projr_ignore_auto for dynamically managed ignore entries, and projr_unignore_manual for forcing certain paths to not be ignored.

Examples

# Manually ignore files and directories
projr_ignore_manual(c("output", "tempfile.log"))
#> Error in ind_vec[["top"]]: subscript out of bounds

# Specifically ignore directories
projr_ignore_manual_dir("data")
#> Error in ind_vec[["top"]]: subscript out of bounds

# Specifically ignore files
projr_ignore_manual_file("README.md")
#> Error in ind_vec[["top"]]: subscript out of bounds