Skip to content

Commit a24c5eb

Browse files
committed
Drop “with” from “withContents” parameter when creating file
1 parent 8db714c commit a24c5eb

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

Sources/ShellOut.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ public extension ShellOutCommand {
168168
}
169169

170170
/// Create a file with a given name and contents (will overwrite any existing file with the same name)
171-
static func createFile(named name: String, withContents contents: String) -> ShellOutCommand {
171+
static func createFile(named name: String, contents: String) -> ShellOutCommand {
172172
var command = "echo"
173173
command.append(argument: contents)
174174
command.append(" > ")

Tests/ShellOutTests/ShellOutTests.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ class ShellOutTests: XCTestCase {
101101
let originPath = tempFolderPath + "/GitTestOrigin"
102102
try shellOut(to: .createFolder(named: "GitTestOrigin"), at: tempFolderPath)
103103
try shellOut(to: .gitInit(), at: originPath)
104-
try shellOut(to: .createFile(named: "Test", withContents: "Hello world"), at: originPath)
104+
try shellOut(to: .createFile(named: "Test", contents: "Hello world"), at: originPath)
105105
try shellOut(to: .gitCommit(message: "Commit"), at: originPath)
106106

107107
// Clone to a new repository and read the file
@@ -113,7 +113,7 @@ class ShellOutTests: XCTestCase {
113113
XCTAssertEqual(try shellOut(to: .readFile(at: filePath)), "Hello world")
114114

115115
// Make a new commit in the origin repository
116-
try shellOut(to: .createFile(named: "Test", withContents: "Hello again"), at: originPath)
116+
try shellOut(to: .createFile(named: "Test", contents: "Hello again"), at: originPath)
117117
try shellOut(to: .gitCommit(message: "Commit"), at: originPath)
118118

119119
// Pull the commit in the clone repository and read the file again

0 commit comments

Comments
 (0)