-
Notifications
You must be signed in to change notification settings - Fork 51
Model additional system commands #332
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Model the pkgbuild command with the usual structure used for other commands. Provide a custom string convertible implementation for configuration so that the configuration can be easily converted into a string for logging and comparison purposes. Create a runEcho() implementation for the build swiftly release script so that commands can output their command-line to the log for reproducibility.
@swift-ci test macOS |
@swift-ci test macOS |
@swift-ci test macOS |
Sources/SwiftlyCore/Commands.swift
Outdated
var args: [String] = [] | ||
|
||
for option in self.options { | ||
args += option.args() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: favour .append(contentsOf:)
over +=
here, as .append
is a more specialized implementation that won't create an intermediate array.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, I've replaced them all with an equivalent append method.
extension Arguments: CustomStringConvertible { | ||
public var description: String { | ||
let normalized: [String] = self.storage.map(\.description).map { | ||
if $0.contains(" ") { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: could be shortened to a ternary
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done, thanks for the suggestion.
Replace if with ternary expression
@swift-ci test macOS |
Model the pkgbuild command with the usual structure used for other commands.
Provide a custom string convertible implementation for configuration so that the
configuration can be easily converted into a string for logging and comparison
purposes.
Create a runEcho() implementation for the build swiftly release script so that
commands can output their command-line to the log for reproducibility.
Add a model for the Linux getent command. Provide a convenience entries() method
that provides a table of the entries for better ease of use.
Model a small subset of the git command for use in the build swiftly release script and
testing of it.