
from __future__ import absolute_import
from __future__ import print_function

import sys

from . import shell


def print_xcodebuild_versions(file=sys.stdout):
    """
    Print the host machine's `xcodebuild` version, as well as version
    information for all available SDKs.
    """
    version = shell.capture(
        ['xcodebuild', '-version'],
        dry_run=False, echo=False, optional=True).rstrip()
    sdks = shell.capture(
        ['xcodebuild', '-version', '-sdk'],
        dry_run=False, echo=False, optional=True).rstrip()
    fmt = """\
{version}

--- SDK versions ---
{sdks}

"""
    print(fmt.format(version=version, sdks=sdks), file=file)
    file.flush()


from __future__ import absolute_import
from __future__ import print_function

import sys

from . import shell


def print_xcodebuild_versions(file=sys.stdout):
    """
    Print the host machine's `xcodebuild` version, as well as version
    information for all available SDKs.
    """
    version = shell.capture(
        ['xcodebuild', '-version'], dry_run=False, echo=False).rstrip()
    sdks = shell.capture(
        ['xcodebuild', '-version', '-sdk'], dry_run=False, echo=False).rstrip()
    fmt = """\
{version}

--- SDK versions ---
{sdks}

"""
    print(fmt.format(version=version, sdks=sdks), file=file)
    file.flush()

Make --show-sdks fail if calling `xcodebuild` failed
[build-script] Make --show-sdks fail if calling `xcodebuild` failed

  
  from __future__ import absolute_import
  from __future__ import print_function
  
  import sys
  
  from . import shell
  
  
  def print_xcodebuild_versions(file=sys.stdout):
      """
      Print the host machine's `xcodebuild` version, as well as version
      information for all available SDKs.
      """
      version = shell.capture(
+         ['xcodebuild', '-version'], dry_run=False, echo=False).rstrip()
-         ['xcodebuild', '-version'],
-         dry_run=False, echo=False, optional=True).rstrip()
      sdks = shell.capture(
+         ['xcodebuild', '-version', '-sdk'], dry_run=False, echo=False).rstrip()
-         ['xcodebuild', '-version', '-sdk'],
-         dry_run=False, echo=False, optional=True).rstrip()
      fmt = """\
  {version}
  
  --- SDK versions ---
  {sdks}
  
  """
      print(fmt.format(version=version, sdks=sdks), file=file)
      file.flush()
  
Make --show-sdks fail if calling `xcodebuild` failed
## Code Before:

from __future__ import absolute_import
from __future__ import print_function

import sys

from . import shell


def print_xcodebuild_versions(file=sys.stdout):
    """
    Print the host machine's `xcodebuild` version, as well as version
    information for all available SDKs.
    """
    version = shell.capture(
        ['xcodebuild', '-version'],
        dry_run=False, echo=False, optional=True).rstrip()
    sdks = shell.capture(
        ['xcodebuild', '-version', '-sdk'],
        dry_run=False, echo=False, optional=True).rstrip()
    fmt = """\
{version}

--- SDK versions ---
{sdks}

"""
    print(fmt.format(version=version, sdks=sdks), file=file)
    file.flush()

## Instruction:
Make --show-sdks fail if calling `xcodebuild` failed
## Code After:

from __future__ import absolute_import
from __future__ import print_function

import sys

from . import shell


def print_xcodebuild_versions(file=sys.stdout):
    """
    Print the host machine's `xcodebuild` version, as well as version
    information for all available SDKs.
    """
    version = shell.capture(
        ['xcodebuild', '-version'], dry_run=False, echo=False).rstrip()
    sdks = shell.capture(
        ['xcodebuild', '-version', '-sdk'], dry_run=False, echo=False).rstrip()
    fmt = """\
{version}

--- SDK versions ---
{sdks}

"""
    print(fmt.format(version=version, sdks=sdks), file=file)
    file.flush()
