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

    Function captureCommandWithExitCode

    • Runs a command string asynchronously and returns stdout, stderr, and exit code. Parses the command string into command and arguments (handles quoted strings). Unlike captureOutput, this function does NOT throw on non-zero exit codes.

      Parameters

      • command: string

        Full command string to be executed (e.g., 'ls -la "my folder"').

      • 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 captureCommandWithExitCode('shopify theme push --theme "My Theme"')
      if (result.exitCode !== 0) {
      console.error('Command failed:', result.stderr)
      }