@shopify/cli-kit
    Preparing search index...

    Function captureOutputWithExitCode

    • Runs a command asynchronously and returns stdout, stderr, and exit code. Unlike captureOutput, this function does NOT throw on non-zero exit codes.

      Parameters

      • command: string

        Command to be executed.

      • args: string[]

        Arguments to pass to the command.

      • Optionaloptions: ExecOptions

        Optional settings for how to run the command.

      Returns Promise<CaptureOutputResult>

      A promise that resolves with stdout, stderr, and exitCode.

      const result = await captureOutputWithExitCode('ls', ['-la'])
      if (result.exitCode !== 0) \{
      console.error('Command failed:', result.stderr)
      \}