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

This commit is contained in:
2022-08-30 17:02:11 +02:00
parent a99466f258
commit 264c221604
60 changed files with 825 additions and 235 deletions

View File

@ -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()