Skip to content

Commit 5644a62

Browse files
authored
Merge pull request #3 from p-x9/feature/arguments
support for configuring `arguments`
2 parents 81c95ea + 4876e98 commit 5644a62

File tree

3 files changed

+14
-3
lines changed

3 files changed

+14
-3
lines changed

README.md

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,17 @@ prebuild: # prebuildCommand
1717
script: "pwd"
1818
- name: "Write file"
1919
script: "echo Hello >> test.txt"
20+
2021
- name: "SwiftLint"
2122
launchPath: "/bin/bash" # bash, zsh, etc. can be specified
2223
script: "swiftlint lint --fix"
2324

25+
- name: "SwiftLint" # Another way to write ↑↑
26+
launchPath: "/usr/local/bin/swiftlint"
27+
arguments:
28+
- "lint"
29+
- "fix"
30+
2431
- name: "Update schema"
2532
file: "update_schema.sh" # Execute .sh file
2633

@@ -31,20 +38,20 @@ build: # build Command
3138
```
3239

3340
## Example
34-
- SwiftLint
41+
- SwiftLint
3542
You can run Lint in SPM without using the SwiftLint plugin.
3643
```yaml
3744
- name: "SwiftLint"
3845
script: "swiftlint lint"
3946
```
4047
4148
- Build Log
42-
```yaml
49+
```yaml
4350
- name: "Build Log"
4451
script: "echo \"[$(date)] Build >> build.log\""
4552
```
4653
47-
- Theos(Orion) install
54+
- Theos(Orion) install
4855
You can install the Tweak from the Build button in SPM.
4956
```yaml
5057
- name: "Theos make package and install"

Sources/run-script/Config.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,6 @@ struct Script: Codable {
2020

2121
let path: String?
2222
let script: String?
23+
24+
let arguments: [String]?
2325
}

Sources/run-script/main.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,8 @@ func run(_ script: Script) throws {
5252

5353
if let path = script.path {
5454
process.arguments = [path]
55+
} else if let arguments = script.arguments, !arguments.isEmpty {
56+
process.arguments = arguments
5557
} else if let script = script.script {
5658
process.arguments = ["-c", script]
5759
}

0 commit comments

Comments
 (0)