Cake.FileHelpers

A set of aliases for Cake to help with simple file operations such as Reading, Writing and Replacing text.

#addin nuget:?package=Cake.FileHelpers&version=7.0.0

dotnet add package Cake.FileHelpers --version 7.0.0

<PackageReference Include="Cake.FileHelpers" Version="7.0.0" />

Aliases

File helper aliases. A set of aliases for Cake Build to help with simple File operations such as Reading, Writing and Replacing text.

General

FileAppendLines(FilePath, Encoding, string[]) Appends all text lines to a file
FileAppendLines(FilePath, string[]) Appends all text lines to a file
FileAppendText(FilePath, Encoding, string) Appends all text to a file
FileAppendText(FilePath, string) Appends all text to a file
FileReadLines(FilePath, Encoding) Reads all lines from a file
FileReadLines(FilePath) Reads all lines from a file
FileReadText(FilePath, Encoding) Reads all text from a file
FileReadText(FilePath) Reads all text from a file
FileTouch(FilePath) Sets the last write time of a file to the current time
FileWriteLines(FilePath, Encoding, string[]) Writes all text lines to a file
FileWriteLines(FilePath, string[]) Writes all text lines to a file
FileWriteText(FilePath, Encoding, string) Writes all text to a file
FileWriteText(FilePath, string) Writes all text to a file
FindRegexInFiles(string, Encoding, string, RegexOptions) Finds files with regular expression pattern in files matching the given globber pattern.
FindRegexInFiles(string, Encoding, string) Finds files with regular expression pattern in files matching the given globber pattern.
FindRegexInFiles(string, string, RegexOptions) Finds files with regular expression pattern in files matching the given globber pattern.
FindRegexInFiles(string, string) Finds files with regular expression pattern in files matching the given globber pattern.
FindRegexMatchesGroupsInFile(FilePath, Encoding, string, RegexOptions) Finds regex matches in a file and returns all match groups.
FindRegexMatchesGroupsInFile(FilePath, string, RegexOptions) Finds regex matches in a file and returns all match groups.
FindRegexMatchesInFile(FilePath, Encoding, string, RegexOptions) Finds the regex matches in a text file.
FindRegexMatchesInFile(FilePath, string, RegexOptions) Finds the regex matches in a text file.
FindRegexMatchGroupInFile(FilePath, Encoding, string, int, RegexOptions) Finds the first regex match in a file and returns a specific match group.
FindRegexMatchGroupInFile(FilePath, string, int, RegexOptions) Finds the first regex match in a file and returns a specific match group.
FindRegexMatchGroupsInFile(FilePath, Encoding, string, RegexOptions) Finds the first regex match in a file and returns all match groups.
FindRegexMatchGroupsInFile(FilePath, string, RegexOptions) Finds the first regex match in a file and returns all match groups.
FindRegexMatchInFile(FilePath, Encoding, string, RegexOptions) Finds the first regex match in a textfile.
FindRegexMatchInFile(FilePath, string, RegexOptions) Finds the first regex match in a textfile.
FindTextInFiles(IEnumerable<FilePath>, Encoding, string) Finds files with the given text in files matching the given collection of files.
FindTextInFiles(IEnumerable<FilePath>, string) Finds files with the given text in files matching the given collection of files.
FindTextInFiles(string, Encoding, string) Finds files with the given text in files matching the given globber pattern.
FindTextInFiles(string, string) Finds files with the given text in files matching the given globber pattern.
ReplaceRegexInFiles(string, Encoding, string, string, RegexOptions) Replaces the regex pattern in files matched by the given globber pattern.
ReplaceRegexInFiles(string, Encoding, string, string) Replaces the regex pattern in files matched by the given globber pattern.
ReplaceRegexInFiles(string, string, string, RegexOptions) Replaces the regex pattern in files matched by the given globber pattern.
ReplaceRegexInFiles(string, string, string) Replaces the regex pattern in files matched by the given globber pattern.
ReplaceTextInFiles(string, Encoding, string, string) Replaces the text in files matched by the given globber pattern
ReplaceTextInFiles(string, string, string) Replaces the text in files matched by the given globber pattern