Skip to content

GitIgnoreStrategy

Ignores file paths based on the .gitignore specification.

Initializers

import { GitIgnoreStrategy } from '@alicloud/ros-cdk-core'
new GitIgnoreStrategy(absoluteRootPath: string, patterns: string[])
Name Type Description
absoluteRootPath string No description.
patterns string[] No description.

absoluteRootPathRequired

  • Type: string

patternsRequired

  • Type: string[]

Methods

Name Description
add Adds another pattern.
ignores Determines whether a given file path should be ignored or not.

add

public add(pattern: string): void

Adds another pattern.

patternRequired

  • Type: string

ignores

public ignores(absoluteFilePath: string): boolean

Determines whether a given file path should be ignored or not.

absoluteFilePathRequired

  • Type: string

absolute file path to be assessed against the pattern.


Static Functions

Name Description
docker Ignores file paths based on the .dockerignore specification.
fromCopyOptions Creates an IgnoreStrategy based on the ignoreMode and exclude in a CopyOptions.
git Ignores file paths based on the .gitignore specification.
glob Ignores file paths based on simple glob patterns.

docker

import { GitIgnoreStrategy } from '@alicloud/ros-cdk-core'
GitIgnoreStrategy.docker(absoluteRootPath: string, patterns: string[])

Ignores file paths based on the .dockerignore specification.

absoluteRootPathRequired

  • Type: string

the absolute path to the root directory of the paths to be considered.


patternsRequired

  • Type: string[]

fromCopyOptions

import { GitIgnoreStrategy } from '@alicloud/ros-cdk-core'
GitIgnoreStrategy.fromCopyOptions(options: CopyOptions, absoluteRootPath: string)

Creates an IgnoreStrategy based on the ignoreMode and exclude in a CopyOptions.

optionsRequired

the CopyOptions to create the IgnoreStrategy from.


absoluteRootPathRequired

  • Type: string

the absolute path to the root directory of the paths to be considered.


git

import { GitIgnoreStrategy } from '@alicloud/ros-cdk-core'
GitIgnoreStrategy.git(absoluteRootPath: string, patterns: string[])

Ignores file paths based on the .gitignore specification.

absoluteRootPathRequired

  • Type: string

the absolute path to the root directory of the paths to be considered.


patternsRequired

  • Type: string[]

glob

import { GitIgnoreStrategy } from '@alicloud/ros-cdk-core'
GitIgnoreStrategy.glob(absoluteRootPath: string, patterns: string[])

Ignores file paths based on simple glob patterns.

absoluteRootPathRequired

  • Type: string

the absolute path to the root directory of the paths to be considered.


patternsRequired

  • Type: string[]