1
- # System
1
+ # ProcessRunner
2
2
3
- ![ System ] ( /system .png )
3
+ ![ ProcessRunner ] ( /processrunner .png )
4
4
5
5
![ Release] ( https://img.shields.io/github/release/eneko/System.svg )
6
6
![ Swift 5.0] ( https://img.shields.io/badge/Swift-5.0-orange.svg )
@@ -29,15 +29,15 @@ scripting (Rakefile, Fastlane, Danger, etc), you will feel like home.
29
29
### 💻 Automatically redirect output to stdout
30
30
31
31
``` swift
32
- import System
32
+ import ProcessRunner
33
33
34
34
try system (command : " echo hello world" ) // prints "hello world" to stdout
35
35
```
36
36
37
37
### ✇ Capture process output
38
38
39
39
``` swift
40
- import System
40
+ import ProcessRunner
41
41
42
42
let output = try system (command : " echo hello world" , captureOutput : true ).standardOutput
43
43
print (output) // prints "hello world"
@@ -46,35 +46,35 @@ print(output) // prints "hello world"
46
46
### ✔️ Check if process terminated gracefully
47
47
48
48
``` swift
49
- import System
49
+ import ProcessRunner
50
50
51
51
print (try system (command : " echo hello world" ).success ) // prints "true"
52
52
```
53
53
54
54
### |> Easily execute Shell commands with pipes and redirects
55
55
56
56
``` swift
57
- import System
57
+ import ProcessRunner
58
58
59
59
try system (shell : " echo hello cat > cat && cat cat | awk '{print $2}'" ) // prints "cat" to stdout
60
60
```
61
61
62
62
## Installation
63
63
64
- Add ` System ` to your ` Package.swift ` :
64
+ Add ` ProcessRunner ` to your ` Package.swift ` :
65
65
66
66
``` swift
67
67
import PackageDescription
68
68
69
69
let package = Package (
70
70
name : " YourPackage" ,
71
71
dependencies : [
72
- .package (url : " git@github.com:eneko/System .git" , from : " 1.0.0" ),
72
+ .package (url : " git@github.com:eneko/ProcessRunner .git" , from : " 1.0.0" ),
73
73
],
74
74
targets : [
75
75
.target (
76
76
name : " YourTarget" ,
77
- dependencies : [" System " ]),
77
+ dependencies : [" ProcessRunner " ]),
78
78
]
79
79
)
80
80
```
0 commit comments