mise API - v0.0.0
    Preparing search index...

    Function commandList_parse

    • Parses a command line into its list: commands joined by ;, && and ||, as POSIX sh reads them. A joiner inside quotes is text. A single | is a pipe and a single & a background mark; neither splits here.

      Parameters

      • line: string

        The full command line.

      Returns ListCommand[]

      The commands in order, each with the condition it runs under.

      commandList_parse("cd ~/uploads && pwd")  // [{ command: 'cd ~/uploads', when: 'always' }, { command: 'pwd', when: 'success' }]
      commandList_parse("ls x || echo none; pwd") // ls x: always; echo none: failure; pwd: always
      commandList_parse("echo 'a && b'") // one command