Class ShellContext

Constructors

Properties

_logger: Logger = logger
logCommand: boolean = false
sleep: ((ms: number) => Promise<void>) = sleep

Accessors

  • get cwd(): string
  • get current word directory

    Returns string

Methods

  • set/get/delete env set: ctx.env('key', 'val') set: ctx.env('key=val') delete: ctx.env('key', void 0)

    Parameters

    • key: string

    Returns this

  • Parameters

    • key: string
    • val: undefined | string

    Returns this

  • restart processes when file changes

    Parameters

    • dir: string
    • run: string | string[] | ((p: {
          current: null | ChildProcess;
      }) => void)
    • options: WatchDirOptions & {
          ignore?: ((event: string, file: null | string) => boolean);
      } = {}

    Returns void

    ctx.monitor('./src', 'tsc')
    ctx.monitor('./src', 'webpack')
    ctx.monitor('./src', 'foy watch')
    ctx.monitor('./src', ['rm -rf dist', 'foy watch'])
    ctx.monitor('./src', async p => {
    await fs.rmrf('dist')
    p.current = ctx.exec('webpack serve')
    })