Terminal
enum Terminal
Terminal utilities
-
Run a script in the shell and return its output
Declaration
Swift
static func runInShell(arguments: [String]) async -> OutputParameters
argumentsThe 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
argumentsThe 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
textThe current text of the document
settingsThe current
AppSettingssceneStateThe current
SceneStateModelfileListThe optional list of files (for a songbook)
titleThe title of the export
subtitleThe optional subtitle of the export
Return Value
The PDF as
Dataand the status asAppError -
Parse a ChordPro message
Declaration
Swift
static func parseChordProMessage(_ output: Terminal.OutputItem) -> BoolParameters
outputThe raw output as read from stdError
Return Value
An item for the internal log
View on GitHub