2019-01-03 06:53:21 +00:00
|
|
|
//
|
|
|
|
// TrashCommand.swift
|
|
|
|
// MasKit
|
|
|
|
//
|
|
|
|
// Created by Ben Chatelain on 1/1/19.
|
|
|
|
// Copyright © 2019 mas-cli. All rights reserved.
|
|
|
|
//
|
|
|
|
|
2019-01-03 07:16:45 +00:00
|
|
|
/// Wrapper for the external trash command. Relies on the "trash" command
|
|
|
|
/// from Homebrew. Trash requires el_capitan or higher for core bottles:
|
|
|
|
/// https://github.com/Homebrew/homebrew-core/blob/master/Formula/trash.rb
|
2019-01-03 06:53:21 +00:00
|
|
|
public struct TrashCommand: ExternalCommand {
|
|
|
|
public var binaryPath: String
|
|
|
|
public var arguments: [String]
|
|
|
|
|
|
|
|
public let process = Process()
|
|
|
|
|
|
|
|
public let stdoutPipe = Pipe()
|
|
|
|
public let stderrPipe = Pipe()
|
|
|
|
|
|
|
|
public init(
|
|
|
|
binaryPath: String = "/usr/local/bin/trash",
|
|
|
|
arguments: [String] = []
|
|
|
|
) {
|
|
|
|
self.binaryPath = binaryPath
|
|
|
|
self.arguments = arguments
|
|
|
|
}
|
|
|
|
}
|