Skip to content

Commit 38cd16d

Browse files
authored
README: Update for new series of commands + path API
1 parent 8675701 commit 38cd16d

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

README.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,13 @@ let output = try shellOut(to: "echo", arguments: ["Hello world"])
1414
print(output) // Hello world
1515
```
1616

17+
You can also easily run a series of commands at once, optionally at a given path:
18+
```swift
19+
try shellOut(to: ["mkdir NewFolder", "echo \"Hello again\" > NewFolder/File"], at: "~/CurrentFolder")
20+
let output = try shellOut(to: "cat File", at: "~/CurrentFolder/NewFolder")
21+
print(output) // Hello again
22+
```
23+
1724
In case of an error, ShellOut will automatically read `STDERR` and format it nicely into a typed Swift error:
1825
```swift
1926
do {

0 commit comments

Comments
 (0)