Skip to content

Utils.Function.join_commands

DecentM edited this page Jan 16, 2026 · 86 revisions

@decentm/concourse-ts / Utils / join_commands

Function: join_commands()

join_commands(customise, ...commands): Command

Defined in: utils/commands/index.ts:31

Joins multiple commands into a single command, by a provided joiner. Any "user" and "dir" properties will be taken from the first command that has them, and applied to the result. You must set these properties in the customiser explicitly if you want to avoid this behaviour.


Example:

const final_command = join_commands((args, command) => {
  command.path = '/bin/sh'

  command.add_args('-exuc')
  command.add_args(args.join(' && '))
}, command_a, command_b)

This will create a new command that runs command_a and command_b in sequence, separated by && to run them sequentially.


Parameters

customise

(instance, parent) => void

Customiser to apply to the resulting command

commands

...Command[]

Commands to join

Returns

Command

Clone this wiki locally