class IgnoreStrategy
Language | Type name |
---|---|
.NET | Amazon.CDK.IgnoreStrategy |
Go | github.com/aws/aws-cdk-go/awscdk/v2#IgnoreStrategy |
Java | software.amazon.awscdk.IgnoreStrategy |
Python | aws_cdk.IgnoreStrategy |
TypeScript (source) | aws-cdk-lib » IgnoreStrategy |
Implemented by
Docker
, Git
, Glob
Represents file path ignoring behavior.
Example
// 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
new IgnoreStrategy()
Methods
Name | Description |
---|---|
add(pattern) | Adds another pattern. |
ignores(absoluteFilePath) | Determines whether a given file path should be ignored or not. |
static docker(absoluteRootPath, patterns) | Ignores file paths based on the .dockerignore specification . |
static from | Creates an IgnoreStrategy based on the ignoreMode and exclude in a CopyOptions . |
static git(absoluteRootPath, patterns) | Ignores file paths based on the .gitignore specification . |
static glob(absoluteRootPath, patterns) | Ignores file paths based on simple glob patterns. |
add(pattern)
public add(pattern: string): void
Parameters
- pattern
string
Adds another pattern.
ignores(absoluteFilePath)
public ignores(absoluteFilePath: string): boolean
Parameters
- absoluteFilePath
string
— absolute file path to be assessed against the pattern.
Returns
boolean
Determines whether a given file path should be ignored or not.
static docker(absoluteRootPath, patterns)
public static docker(absoluteRootPath: string, patterns: string[]): DockerIgnoreStrategy
Parameters
- absoluteRootPath
string
— the absolute path to the root directory of the paths to be considered. - patterns
string[]
Returns
Ignores file paths based on the .dockerignore specification
.
CopyOptions(options, absoluteRootPath)
static frompublic static fromCopyOptions(options: CopyOptions, absoluteRootPath: string): IgnoreStrategy
Parameters
- options
Copy
— theOptions CopyOptions
to create theIgnoreStrategy
from. - absoluteRootPath
string
— the absolute path to the root directory of the paths to be considered.
Returns
Creates an IgnoreStrategy based on the ignoreMode
and exclude
in a CopyOptions
.
static git(absoluteRootPath, patterns)
public static git(absoluteRootPath: string, patterns: string[]): GitIgnoreStrategy
Parameters
- absoluteRootPath
string
— the absolute path to the root directory of the paths to be considered. - patterns
string[]
Returns
Ignores file paths based on the .gitignore specification
.
static glob(absoluteRootPath, patterns)
public static glob(absoluteRootPath: string, patterns: string[]): GlobIgnoreStrategy
Parameters
- absoluteRootPath
string
— the absolute path to the root directory of the paths to be considered. - patterns
string[]
Returns
Ignores file paths based on simple glob patterns.