Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions Sources/PDFArchiverWebsite/PublishingSteps.swift
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,15 @@ extension PublishingStep where Site == PDFArchiverWebsite {
let root = try context.folder(at: "")
let destination = try context.outputFolder(at: "").path + "presskit.zip"

// `zip` adds to an archive that already exists, and `Output/` survives a local build,
// so a file deleted from `presskit/` would otherwise stay in the kit forever.
try? FileManager.default.removeItem(atPath: destination)

let zip = Process()
zip.executableURL = URL(fileURLWithPath: "/usr/bin/zip")
// -X drops the resource forks and __MACOSX entries the Finder would add.
zip.arguments = ["-r", "-q", "-X", destination, "presskit"]
// -X drops the resource forks and __MACOSX entries the Finder would add; .DS_Store is
// git-ignored, so it only ever reaches the archive from a local build.
zip.arguments = ["-r", "-q", "-X", destination, "presskit", "-x", "*.DS_Store"]
zip.currentDirectoryURL = URL(fileURLWithPath: root.path)

try zip.run()
Expand Down