Skip to content

Commit

Permalink
Merge pull request #4 from freddi-kit/fix-lipo
Browse files Browse the repository at this point in the history
Fix lipo
  • Loading branch information
freddi-kit authored Aug 16, 2023
2 parents 64bdd7c + bf02f5a commit 7289d92
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ struct ArtifactBundleGenCommand: CommandPlugin {
}

guard let configString = configOption.first, let config = Config(rawValue: configString) else {
throw ArtifactBundleGenError.configOptionParseError(configString: configOption.first ?? "{empty}")
throw ArtifactBundleGenError.configOptionParseError(configString: configOption.first)
}

let artifactBundleGen = ArtifactBundleGen(
Expand Down
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,5 +82,4 @@ $ ls


## TODOs
- [ ] include LICENSE file
- [ ] Suport other type
- [ ] Suport XCFramework
11 changes: 8 additions & 3 deletions Sources/ArtifactBundleGen/Error/ArtifactBundleGenError.swift
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ enum ArtifactBundleGenError: LocalizedError, CustomStringConvertible {
case cleanFailure(error: Error)

case nameOptionMissing
case configOptionParseError(configString: String)
case configOptionParseError(configString: String?)

var description: String { return errorDescription ?? "Unexpected Error" }

Expand All @@ -29,8 +29,13 @@ enum ArtifactBundleGenError: LocalizedError, CustomStringConvertible {
case .fileCopyFailure(let origin, let destination, let error): return "Failed to copy file from \"\(origin)\" to \"\(destination)\" : \(error.localizedDescription)"
case .lipoFailure(let error): return "Failed to run lipo: \(error.localizedDescription)"
case .lipoEmptyResult: return "Error, lipo returns empty result"
case .nameOptionMissing: return "Please specify to name by --package-name"
case .configOptionParseError(let configString): return "Failed to parse config specified by --build-config: \(configString)"
case .nameOptionMissing: return "Please specify to name by --executable-name"
case .configOptionParseError(let configString):
if let configString {
return "Failed to parse config specified by --build-config: \(configString)"
} else {
return "Failed to parse config specified by --build-config: Please specify release or debug"
}
case .zipFailure(error: let error): return "Failed to zip artifact bundle: \(error.localizedDescription)"
case .cleanFailure(error: let error): return "Failed to clean artifact bundle: \(error.localizedDescription)"
}
Expand Down
3 changes: 1 addition & 2 deletions Sources/ArtifactBundleGen/Utils/LipoRunnner.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@ class LipoRunnner {

task.standardOutput = pipe
task.standardError = pipe
task.launchPath = "/usr/bin/xcrun"
task.arguments = ["lipo", "-archs", "\(targetPath)"]
task.arguments = ["-c", "lipo -archs \(targetPath)"]
task.launchPath = "/bin/zsh"
task.standardInput = nil
do {
Expand Down

0 comments on commit 7289d92

Please sign in to comment.