Skip to content

Commit 40cefda

Browse files
authored
Merge pull request #33 from codeOfRobin/master
Added --force
2 parents 26ec0be + 1668f2f commit 40cefda

File tree

4 files changed

+9
-3
lines changed

4 files changed

+9
-3
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ Besides using the guide to input information, SwiftPlate also supports command l
5454
| GitHub URL | Any URL you'll be hosting the project at (for Podspec) | `--url` | `-u` |
5555
| Organization name | The name of your organization | `--organization` | `-o` |
5656
| Repo | Any custom SwiftPlate repository that should be used for templates | `--repo` | `-r` |
57+
| Force | Prevent user prompt at the end (for CIs etc.) | `--force` | `-f` |
5758

5859
## Questions or feedback?
5960

SwiftPlate.xcodeproj/project.pbxproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424

2525
/* Begin PBXFileReference section */
2626
52CC95EA1DE1DF29000B8859 /* swiftplate */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = swiftplate; sourceTree = BUILT_PRODUCTS_DIR; };
27-
52CC95F41DE1DF51000B8859 /* main.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = main.swift; sourceTree = "<group>"; };
27+
52CC95F41DE1DF51000B8859 /* main.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = main.swift; sourceTree = "<group>"; usesTabs = 0; };
2828
/* End PBXFileReference section */
2929

3030
/* Begin PBXFrameworksBuildPhase section */

main

116 KB
Binary file not shown.

main.swift

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ struct Arguments {
7777
var githubURL: String?
7878
var organizationName: String?
7979
var repositoryURL: URL?
80+
var forceEnabled: Bool = false
8081

8182
init(commandLineArguments arguments: [String]) {
8283
for (index, argument) in arguments.enumerated() {
@@ -97,6 +98,8 @@ struct Arguments {
9798
if let urlString = arguments.element(after: index) {
9899
repositoryURL = URL(string: urlString)
99100
}
101+
case "--force", "-f":
102+
forceEnabled = true
100103
default:
101104
break
102105
}
@@ -263,8 +266,10 @@ if let organizationName = organizationName {
263266

264267
print("---------------------------------------------------------------------")
265268

266-
if !askForBooleanInfo(question: "Proceed? ✅") {
267-
exit(0)
269+
if !arguments.forceEnabled {
270+
if !askForBooleanInfo(question: "Proceed? ✅") {
271+
exit(0)
272+
}
268273
}
269274

270275
print("🚀 Starting to generate project \(projectName)...")

0 commit comments

Comments
 (0)