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=3.3.0

<package id="Cake.FileHelpers" version="3.3.0" />

dotnet add package Cake.FileHelpers --version 3.3.0

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