/
Launch Apollo Studio


STRUCT

ApolloCLI

public struct ApolloCLI

Wrapper for calling the bundled node-based Apollo CLI.

Properties

binaryFolderURL

public let binaryFolderURL: URL

Methods

createCLI(cliFolderURL:timeout:)

public static func createCLI(cliFolderURL: URL, timeout: Double) throws -> ApolloCLI

Creates an instance of ApolloCLI, downloading and extracting if needed

  • Parameters:

    • cliFolderURL: The URL to the folder which contains the zip file with the CLI.
    • timeout: The maximum time to wait before indicating that the download timed out, in seconds.

Parameters

NameDescription
cliFolderURLThe URL to the folder which contains the zip file with the CLI.
timeoutThe maximum time to wait before indicating that the download timed out, in seconds.

init(binaryFolderURL:)

public init(binaryFolderURL: URL)

Designated initializer

  • Parameter binaryFolderURL: The folder where the extracted binary files live.

Parameters

NameDescription
binaryFolderURLThe folder where the extracted binary files live.

runApollo(with:from:)

public func runApollo(with arguments: [String],
                      from folder: URL? = nil) throws -> String

Runs a command with the bundled Apollo CLI

NOTE: Will always run the --version command first for debugging purposes.

  • Parameter arguments: The arguments to hand to the CLI
  • Parameter folder: The folder to run the command from.

Parameters

NameDescription
argumentsThe arguments to hand to the CLI
folderThe folder to run the command from.
Edit on GitHub