From 38cd16db073d7c250cefdda177dc14d11597ed04 Mon Sep 17 00:00:00 2001 From: John Sundell Date: Tue, 11 Apr 2017 17:01:12 +0200 Subject: [PATCH] README: Update for new series of commands + path API --- README.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/README.md b/README.md index b959b66..9993fc3 100644 --- a/README.md +++ b/README.md @@ -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 {