Skip to content

Commit

Permalink
README: Update for new series of commands + path API
Browse files Browse the repository at this point in the history
  • Loading branch information
JohnSundell authored Apr 11, 2017
1 parent 8675701 commit 38cd16d
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,13 @@ let output = try shellOut(to: "echo", arguments: ["Hello world"])
print(output) // Hello world
```

You can also easily run a series of commands at once, optionally at a given path:
```swift
try shellOut(to: ["mkdir NewFolder", "echo \"Hello again\" > NewFolder/File"], at: "~/CurrentFolder")
let output = try shellOut(to: "cat File", at: "~/CurrentFolder/NewFolder")
print(output) // Hello again
```

In case of an error, ShellOut will automatically read `STDERR` and format it nicely into a typed Swift error:
```swift
do {
Expand Down

0 comments on commit 38cd16d

Please sign in to comment.