Skip to main content

context

The context action ensures that a particular context is true. If the context is not true, the action will fail.

Usage

{
type: 'context',
context: 'inProject'
}

Properties

NameDescriptionDefaultRequired
contextThe context to checkYes
targetThe path to the directoryNo

context

Type: string or string[]

The context to check. If the context is not true, the action will fail.

Here are the available contexts:

  • inProject: Checks if the current working directory is a project directory (contains a package.json file)
  • notInProject: Checks if the current working directory is not a project directory (does not contain a package.json file)
  • inPandaProject: Checks if the current working directory is a Panda project directory
  • notInPandaProject: Checks if the current working directory is not a Panda project directory

target

Type: string

The path to the directory that the context should be checked in.

If not provided, the context will be checked in the current working directory. If targetBase is provided, the target will be relative to that base.

Examples

Basic inProject Check

{
type: 'context',
context: 'inProject'
}

Check in a Specific Directory

{
type: 'context',
context: 'inProject',
target: 'path/to/directory'
}