Refactor in one unique command with subcommand + add a new command to generate ressources from a configuration file
Some checks failed
gitea-openium/resgen.swift/pipeline/head There was a failure building this commit
Some checks failed
gitea-openium/resgen.swift/pipeline/head There was a failure building this commit
This commit is contained in:
@ -10,14 +10,14 @@ import Foundation
|
||||
public class Shell {
|
||||
|
||||
@discardableResult
|
||||
public static func shell(_ args: String...) -> (terminationStatus: Int32, output: String?) {
|
||||
public static func shell(launchPath: String = "/usr/bin/env", _ args: String...) -> (terminationStatus: Int32, output: String?) {
|
||||
let task = Process()
|
||||
task.launchPath = "/usr/bin/env"
|
||||
task.launchPath = launchPath
|
||||
task.arguments = args
|
||||
|
||||
let pipe = Pipe()
|
||||
task.standardOutput = pipe
|
||||
task.launch()
|
||||
try? task.run()
|
||||
task.waitUntilExit()
|
||||
|
||||
let data = pipe.fileHandleForReading.readDataToEndOfFile()
|
||||
@ -30,9 +30,9 @@ public class Shell {
|
||||
}
|
||||
|
||||
@discardableResult
|
||||
public static func shell(_ args: [String]) -> (terminationStatus: Int32, output: String?) {
|
||||
public static func shell(launchPath: String = "/usr/bin/env", _ args: [String]) -> (terminationStatus: Int32, output: String?) {
|
||||
let task = Process()
|
||||
task.launchPath = "/usr/bin/env"
|
||||
task.launchPath = launchPath
|
||||
task.arguments = args
|
||||
|
||||
let pipe = Pipe()
|
||||
|
Reference in New Issue
Block a user