GlobIgnoreStrategy Class
Ignores file paths based on simple glob patterns.
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 globIgnoreStrategy = new cdk.GlobIgnoreStrategy('absoluteRootPath', ['patterns']);
python
# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
import aws_cdk as cdk
glob_ignore_strategy = cdk.GlobIgnoreStrategy("absoluteRootPath", ["patterns"])
java
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import software.amazon.awscdk.*;
GlobIgnoreStrategy globIgnoreStrategy = new GlobIgnoreStrategy("absoluteRootPath", List.of("patterns"));
csharp
// Install: dotnet add package Amazon.CDK.Lib
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
using Amazon.CDK;
var globIgnoreStrategy = new GlobIgnoreStrategy("absoluteRootPath", new [] { "patterns" });
go
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import cdk "github.com/aws/aws-cdk-go/awscdk"
globIgnoreStrategy := cdk.NewGlobIgnoreStrategy(jsii.String("absoluteRootPath"), []*string{
jsii.String("patterns"),
})
Initializer
ts
new GlobIgnoreStrategy(absoluteRootPath: string, patterns: string[])
python
GlobIgnoreStrategy(absolute_root_path: str, patterns: typing.List[str])
java
new GlobIgnoreStrategy(String absoluteRootPath, List<String> patterns)
csharp
new GlobIgnoreStrategy(string absoluteRootPath, string[] patterns)
go
NewGlobIgnoreStrategy(AbsoluteRootPath *string, Patterns *[]*string)
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@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 // chainable@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