Skip to content

Commit

Permalink
Merge pull request #2 from Gobans/fix/scripts/dependency
Browse files Browse the repository at this point in the history
[Feat] scripts 들에 signal 추가
  • Loading branch information
baekteun committed May 2, 2023
2 parents 16a22d1 + e07b4b3 commit aa9007e
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 0 deletions.
6 changes: 6 additions & 0 deletions Scripts/CodeSigning.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,12 @@ func writeContentInFile(path: String, content: String) {
try? data.write(to: fileURL)
}

func handleSIGINT(_ signal: Int32) -> Void {
exit(0)
}

signal(SIGINT, handleSIGINT)

print("Enter your Apple Developer ID Code Signing Identity: ", terminator: "")
guard let codeSigningIdentity = readLine() else {
fatalError()
Expand Down
6 changes: 6 additions & 0 deletions Scripts/GenerateModule.swift
Original file line number Diff line number Diff line change
Expand Up @@ -173,9 +173,15 @@ func updateFileContent(
try? writeHandle.close()
}

func handleSIGINT(_ signal: Int32) -> Void {
exit(0)
}


// MARK: - Starting point

signal(SIGINT, handleSIGINT)

print("Enter layer name\n(Feature | Domain | Core | Shared | UserInterface)", terminator: " : ")
let layerInput = readLine()
guard
Expand Down
6 changes: 6 additions & 0 deletions Scripts/InitEnvironment.swift
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,12 @@ func makeEnv(projectName: String, organizationName: String) {
writeCodeInFile(filePath: currentPath + "Plugin/EnvironmentPlugin/ProjectDescriptionHelpers/ProjectEnvironment.swift", codes: env)
}

func handleSIGINT(_ signal: Int32) -> Void {
exit(0)
}

signal(SIGINT, handleSIGINT)

print("Enter your project name", terminator: " : ")
let projectName = readLine() ?? ""

Expand Down
6 changes: 6 additions & 0 deletions Scripts/NewDependency.swift
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,12 @@
registerDependencySPM(name: name, package: package)
}

func handleSIGINT(_ signal: Int32) -> Void {
exit(0)
}

signal(SIGINT, handleSIGINT)

print("Enter dependency name", terminator: " : ")
guard let dependencyName = readLine() else {
fatalError("Dependency name is nil")
Expand Down

0 comments on commit aa9007e

Please sign in to comment.