Terminal
enum Terminal
Terminal utilities
-
Run a script in the shell and return its output
Declaration
Swift
static func runInShell(arguments: [String]) async -> Output
Parameters
arguments
The arguments to pass to the shell
Return Value
The output from the shell
-
Run a script in the shell and return its output
Declaration
Swift
static func runInShell(arguments: [String]) -> AsyncStream<StreamedOutput>
Parameters
arguments
The arguments to pass to the shell
Return Value
The output from the shell as a stream
-
The complete output from the shell
See moreDeclaration
Swift
struct Output
-
The stream output from the shell
See moreDeclaration
Swift
enum StreamedOutput
-
The structure for an output item
See moreDeclaration
Swift
struct OutputItem
-
We are using the official ChordPro binary to create the PDF
Note
The executable is packed in this applicationDeclaration
Swift
static func getChordProBinary() async throws -> URL
-
Get access to the optional custom config
Declaration
Swift
static func getOptionalCustomConfig(settings: AppSettings) -> String?
-
Export a document or folder with the ChordPro binary to a PDF
Declaration
Swift
static func exportPDF( text: String, settings: AppSettings, sceneState: SceneStateModel, fileList: Bool = false, title: String = "", subtitle: String = "" ) async throws -> (data: Data, status: AppError)
Parameters
text
The current text of the document
settings
The current
AppSettings
sceneState
The current
SceneStateModel
fileList
The optional list of files (for a songbook)
title
The title of the export
subtitle
The optional subtitle of the export
Return Value
The PDF as
Data
and the status asAppError
-
Parse a ChordPro message
Declaration
Swift
static func parseChordProMessage(_ output: Terminal.OutputItem) -> Bool
Parameters
output
The raw output as read from stdError
Return Value
An item for the internal log