IgnoreStrategy Class
Represents file path ignoring behavior.
Example
ts
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import * as cdk from 'aws-cdk-lib';
const ignoreStrategy = cdk.IgnoreStrategy.fromCopyOptions({
exclude: ['exclude'],
follow: cdk.SymlinkFollowMode.NEVER,
ignoreMode: cdk.IgnoreMode.GLOB,
}, 'absoluteRootPath');
Initializer
ts
new IgnoreStrategy()
python
IgnoreStrategy()
java
new IgnoreStrategy()
csharp
new IgnoreStrategy()
go
NewIgnoreStrategy()
Methods
add(pattern: string): voiddef add(self, pattern: str) -> Nonepublic void add(String pattern)public void Add(string pattern)func Add(Pattern *string)#Adds another pattern.
completelyIgnores(absoluteDirectoryPath: string): booleandef completely_ignores(self, absolute_directory_path: str) -> boolpublic Boolean completelyIgnores(String absoluteDirectoryPath)public bool CompletelyIgnores(string absoluteDirectoryPath)func CompletelyIgnores(AbsoluteDirectoryPath *string) *bool#Determines whether a given directory path should be ignored and have all of its children ignored.
1 parameter · returns
Parameters
absoluteDirectoryPathabsolute_directory_pathabsoluteDirectoryPathabsoluteDirectoryPathAbsoluteDirectoryPath— absolute directory path to be assessed against the pattern.
Returns: true if the directory and all of its children should be ignored
docker(absoluteRootPath: string, patterns: string[]): DockerIgnoreStrategy@staticmethod def docker(absolute_root_path: str, patterns: typing.List[str]) -> DockerIgnoreStrategypublic static DockerIgnoreStrategy docker(String absoluteRootPath, List<String> patterns)public static DockerIgnoreStrategy Docker(string absoluteRootPath, string[] patterns)func Docker(AbsoluteRootPath *string, Patterns *[]*string) DockerIgnoreStrategystatic#Ignores file paths based on the [`.dockerignore specification`](https://docs.docker.com/engine/reference/builder/#dockerignore-file).
1 parameter · returns
Parameters
absoluteRootPathabsolute_root_pathabsoluteRootPathabsoluteRootPathAbsoluteRootPath— the absolute path to the root directory of the paths to be considered.
Returns: DockerIgnorePattern associated with the given patterns.
fromCopyOptions(options: CopyOptions, absoluteRootPath: string): IgnoreStrategy // chainable@staticmethod def from_copy_options(options: CopyOptions, absolute_root_path: str) -> IgnoreStrategypublic static IgnoreStrategy fromCopyOptions(CopyOptions options, String absoluteRootPath)public static IgnoreStrategy FromCopyOptions(CopyOptions options, string absoluteRootPath)func FromCopyOptions(Options CopyOptions, AbsoluteRootPath *string) IgnoreStrategystatic#Creates an IgnoreStrategy based on the `ignoreMode` and `exclude` in a `CopyOptions`.
2 parameters · returns
Parameters
optionsoptionsoptionsoptionsOptions— theCopyOptionsto create theIgnoreStrategyfrom.absoluteRootPathabsolute_root_pathabsoluteRootPathabsoluteRootPathAbsoluteRootPath— the absolute path to the root directory of the paths to be considered.
Returns: IgnoreStrategy based on the CopyOptions
git(absoluteRootPath: string, patterns: string[]): GitIgnoreStrategy@staticmethod def git(absolute_root_path: str, patterns: typing.List[str]) -> GitIgnoreStrategypublic static GitIgnoreStrategy git(String absoluteRootPath, List<String> patterns)public static GitIgnoreStrategy Git(string absoluteRootPath, string[] patterns)func Git(AbsoluteRootPath *string, Patterns *[]*string) GitIgnoreStrategystatic#Ignores file paths based on the [`.gitignore specification`](https://git-scm.com/docs/gitignore).
1 parameter · returns
Parameters
absoluteRootPathabsolute_root_pathabsoluteRootPathabsoluteRootPathAbsoluteRootPath— the absolute path to the root directory of the paths to be considered.
Returns: GitIgnorePattern associated with the given patterns.
glob(absoluteRootPath: string, patterns: string[]): GlobIgnoreStrategy@staticmethod def glob(absolute_root_path: str, patterns: typing.List[str]) -> GlobIgnoreStrategypublic static GlobIgnoreStrategy glob(String absoluteRootPath, List<String> patterns)public static GlobIgnoreStrategy Glob(string absoluteRootPath, string[] patterns)func Glob(AbsoluteRootPath *string, Patterns *[]*string) GlobIgnoreStrategystatic#Ignores file paths based on simple glob patterns.
1 parameter · returns
Parameters
absoluteRootPathabsolute_root_pathabsoluteRootPathabsoluteRootPathAbsoluteRootPath— the absolute path to the root directory of the paths to be considered.
Returns: GlobIgnorePattern associated with the given patterns.
ignores(absoluteFilePath: string): booleandef ignores(self, absolute_file_path: str) -> boolpublic Boolean ignores(String absoluteFilePath)public bool Ignores(string absoluteFilePath)func Ignores(AbsoluteFilePath *string) *bool#Determines whether a given file path should be ignored or not.
1 parameter · returns
Parameters
absoluteFilePathabsolute_file_pathabsoluteFilePathabsoluteFilePathAbsoluteFilePath— absolute file path to be assessed against the pattern.
Returns: true if the file should be ignored