This commit is contained in:
2023-03-14 16:23:16 -04:00
parent 37f3bfde62
commit 78bfa7863a
18 changed files with 237 additions and 217 deletions

View File

@@ -106,10 +106,20 @@ public struct FileClient {
try self.write(data, url)
}
/// Write's the given string to a file.
///
/// - Parameters:
/// - string: The string to write to the file.
/// - url: The file url.
public func write(string: String, to url: URL) throws {
try self.write(Data(string.utf8), url)
}
/// Write's the the string to a file path.
///
/// - Parameters:
/// - string: The string to write to the file.
/// - path: The file path.
public func write(string: String, to path: String) throws {
let url = try url(for: path)
try self.write(string: string, to: url)

View File

@@ -105,8 +105,6 @@ extension ShellClient {
/// Reads contents at the given file path, then allows the caller to act on the
/// results after "nil" has been replaced with the current version string.
///
/// > Note: The file contents will be reset back to nil after the closure operation.
///
/// - Parameters:
/// - filePath: The file path to replace nil in.
/// - workingDirectory: Customize the working directory for the command.