-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathprojr_ignore.Rd
58 lines (55 loc) · 2.25 KB
/
projr_ignore.Rd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/ignore-manual.R
\name{projr_ignore}
\alias{projr_ignore}
\title{Manually Ignore Files or Directories in \code{.gitignore} and \code{.Rbuildignore}}
\usage{
projr_ignore(ignore)
}
\arguments{
\item{ignore}{A character vector of file or directory paths to be ignored.
Paths must be valid non-empty strings.}
}
\value{
Invisibly returns \code{TRUE} if the operation succeeds, or \code{FALSE} if the input
contains invalid (empty) paths.
}
\description{
These functions allow manual addition of files and directories to the
\code{.gitignore} and \code{.Rbuildignore} files, outside of the automatic management
provided by the \code{projr} package.
\itemize{
\item .ignore_manual\verb{: General function to add both files and directories to both }.gitignore\code{and}.Rbuildignore`. If a path does not exist, it is
treated as a file.
\item .ignore_manual_dir\verb{: Specifically adds directories to both }.gitignore\code{and}.Rbuildignore`.
\item .ignore_manual_file\verb{: Specifically adds files to both }.gitignore\code{and}.Rbuildignore`.
\item .ignore_manual_dir_git\verb{ and .ignore_manual_file_git}: Add
directories or files explicitly to \code{.gitignore}.
\item .ignore_manual_dir_rbuild\verb{ and .ignore_manual_file_rbuild}: Add
directories or files explicitly to \code{.Rbuildignore}.
}
}
\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 \code{projr}.
\itemize{
\item Non-existent paths provided to .ignore_manual` are assumed to be files.
\item For \code{.gitignore}, directories are automatically appended with \verb{/**} if
missing, ensuring proper Git ignore syntax.
\item For \code{.Rbuildignore}, paths are converted to regular expressions using
\code{glob2rx} for compatibility with R's build tools.
}
}
\examples{
# Manually ignore files and directories
projr_ignore_manual(c("output", "tempfile.log"))
# Specifically ignore directories
projr_ignore_dir("data")
# Specifically ignore files
projr_ignore_file("README.md")
}
\seealso{
.ignore_auto\verb{ for dynamically managed ignore entries, and .unignore_manual}
for forcing certain paths to not be ignored.
}