You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+63-1Lines changed: 63 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,7 +7,7 @@ Even though you can accomplish most of the tasks you need to do in native Swift
7
7
8
8
## Usage
9
9
10
-
Just call `shellOut()`, and specify what command you want to run, along with any arguments you want to pass:
10
+
Just call `shellOut()`, and specify what command you want to run, along with any arguments you want to pass:
11
11
12
12
```swift
13
13
let output =tryshellOut(to: "echo", arguments: ["Hello world"])
@@ -32,6 +32,68 @@ do {
32
32
}
33
33
```
34
34
35
+
## Pre-defined commands
36
+
37
+
Another way to use ShellOut is by executing pre-defined commands, that enable you to easily perform common tasks without having to construct commands using strings. It also ships with a set of such pre-defined commands for common tasks, such as using Git, manipulating the file system and using tools like [Marathon](https://github.com/JohnSundell/Marathon), [CocoaPods](https://cocoapods.org) and [Fastlane](https://fastlane.tools).
38
+
39
+
### Use Git
40
+
41
+
```swift
42
+
tryshellOut(to: .gitInit())
43
+
tryshellOut(to: .gitClone(url: repositoryURL))
44
+
tryshellOut(to: .gitCommit(message: "A scripted commit!"))
Don't see what you're looking for in the list above? You can easily define your own commands using `ShellOutCommand`. If you've made a command you think should be included among the built-in ones, feel free to [open a PR](https://github.com/JohnSundell/ShellOut/pull/new/master)!
0 commit comments