# core/resolvers/shell.resolver.ts

> 14 lines of code and 1 definition.

Tree: GovLab Pipeline
Language: typescript
Layer: infrastructure
Canonical: https://banes-lab.com/anatomy/pipeline#file-pipeline-core-resolvers-shell-resolver-ts
Source text: https://banes-lab.com/source/pipeline/core/resolvers/shell.resolver.ts.txt

Listed in [core/resolvers](https://banes-lab.com/api/source/pipeline/core/resolvers.md).

## Definitions

- `shellFor` (lexical_declaration, line 10, exported)

## Contained in

- [core/resolvers](https://banes-lab.com/anatomy/pipeline/folder-pipeline-core-resolvers.md)

## Source

```typescript
import {
    POSIX_FLAG,
    POSIX_SHELL,
    WINDOWS,
    WINDOWS_FLAG,
    WINDOWS_SHELL,
} from "#configuration/constants/shell.constants";
import type { ShellDescriptor } from "#types/shell.types";

export const shellFor = function shellFor(platform: string, commandProcessor?: string): ShellDescriptor {
    if (platform !== WINDOWS) {
        return { flag: POSIX_FLAG, shell: POSIX_SHELL };
    }
    return { flag: WINDOWS_FLAG, shell: commandProcessor ?? WINDOWS_SHELL };
};
```
