2019-01-03 15:15:53 -08:00
|
|
|
//
|
2019-01-03 17:15:50 -08:00
|
|
|
// OpenSystemCommand.swift
|
2019-01-03 15:15:53 -08:00
|
|
|
// MasKit
|
|
|
|
//
|
|
|
|
// Created by Ben Chatelain on 1/2/19.
|
|
|
|
// Copyright © 2019 mas-cli. All rights reserved.
|
|
|
|
//
|
|
|
|
|
2021-04-14 12:08:55 -07:00
|
|
|
import Foundation
|
|
|
|
|
2019-01-03 15:15:53 -08:00
|
|
|
/// Wrapper for the external open system command.
|
|
|
|
/// https://ss64.com/osx/open.html
|
2021-04-21 18:05:36 -07:00
|
|
|
struct OpenSystemCommand: ExternalCommand {
|
|
|
|
var binaryPath: String
|
2019-01-03 15:15:53 -08:00
|
|
|
|
2021-04-21 18:05:36 -07:00
|
|
|
let process = Process()
|
2019-01-03 15:15:53 -08:00
|
|
|
|
2021-04-21 18:05:36 -07:00
|
|
|
let stdoutPipe = Pipe()
|
|
|
|
let stderrPipe = Pipe()
|
2019-01-03 15:15:53 -08:00
|
|
|
|
2021-04-21 18:05:36 -07:00
|
|
|
init(binaryPath: String = "/usr/bin/open") {
|
2019-01-03 15:15:53 -08:00
|
|
|
self.binaryPath = binaryPath
|
|
|
|
}
|
|
|
|
}
|