small tweaks

This commit is contained in:
Kabir Oberai
2025-07-27 18:14:34 -04:00
Unverified
parent 576973692a
commit 4262bfa077
2 changed files with 6 additions and 6 deletions
+2 -6
View File
@@ -137,12 +137,8 @@ struct DevBuildCommand: AsyncParsableCommand {
if ipa {
@Dependency(\.zipCompressor) var compressor
finalURL = url.deletingPathExtension().appendingPathExtension("ipa")
let tmpDir = try TemporaryDirectory(name: "sh.xtool.tmp")
let payloadDir = tmpDir.url.appendingPathComponent("Payload", isDirectory: true)
try FileManager.default.createDirectory(
at: payloadDir,
withIntermediateDirectories: true
)
let tmpDir = try TemporaryDirectory(name: "Payload")
let payloadDir = tmpDir.url
try FileManager.default.moveItem(at: url, to: payloadDir.appendingPathComponent(url.lastPathComponent))
let ipaURL = try await compressor.compress(directory: payloadDir) { progress in
if let progress {
+4
View File
@@ -13,6 +13,10 @@ package struct TemporaryDirectory: ~Copyable {
_ = TemporaryDirectoryRoot.shared
}
/// Creates a temporary directory where `lastPathComponent` is exactly `name`.
///
/// The directory is deleted on deinit or (if the object never deinits) on next launch.
/// To save the contents, move them elsewhere with ``persist(at:)``.
package init(name: String) throws {
do {
let basename = name.replacingOccurrences(of: ".", with: "_")