Skip to content

Commit aa9007e

Browse files
authored
Merge pull request #2 from Gobans/fix/scripts/dependency
[Feat] scripts 들에 signal 추가
2 parents 16a22d1 + e07b4b3 commit aa9007e

File tree

4 files changed

+24
-0
lines changed

4 files changed

+24
-0
lines changed

Scripts/CodeSigning.swift

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,12 @@ func writeContentInFile(path: String, content: String) {
77
try? data.write(to: fileURL)
88
}
99

10+
func handleSIGINT(_ signal: Int32) -> Void {
11+
exit(0)
12+
}
13+
14+
signal(SIGINT, handleSIGINT)
15+
1016
print("Enter your Apple Developer ID Code Signing Identity: ", terminator: "")
1117
guard let codeSigningIdentity = readLine() else {
1218
fatalError()

Scripts/GenerateModule.swift

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -173,9 +173,15 @@ func updateFileContent(
173173
try? writeHandle.close()
174174
}
175175

176+
func handleSIGINT(_ signal: Int32) -> Void {
177+
exit(0)
178+
}
179+
176180

177181
// MARK: - Starting point
178182

183+
signal(SIGINT, handleSIGINT)
184+
179185
print("Enter layer name\n(Feature | Domain | Core | Shared | UserInterface)", terminator: " : ")
180186
let layerInput = readLine()
181187
guard

Scripts/InitEnvironment.swift

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,12 @@ func makeEnv(projectName: String, organizationName: String) {
4343
writeCodeInFile(filePath: currentPath + "Plugin/EnvironmentPlugin/ProjectDescriptionHelpers/ProjectEnvironment.swift", codes: env)
4444
}
4545

46+
func handleSIGINT(_ signal: Int32) -> Void {
47+
exit(0)
48+
}
49+
50+
signal(SIGINT, handleSIGINT)
51+
4652
print("Enter your project name", terminator: " : ")
4753
let projectName = readLine() ?? ""
4854

Scripts/NewDependency.swift

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,12 @@
4747
registerDependencySPM(name: name, package: package)
4848
}
4949

50+
func handleSIGINT(_ signal: Int32) -> Void {
51+
exit(0)
52+
}
53+
54+
signal(SIGINT, handleSIGINT)
55+
5056
print("Enter dependency name", terminator: " : ")
5157
guard let dependencyName = readLine() else {
5258
fatalError("Dependency name is nil")

0 commit comments

Comments
 (0)