Repository navigation
feat: add Compress action - #79
Open
prismatic7 wants to merge 5 commits into
Open
prismatic7 wants to merge 5 commits into
prismatic7 wants to merge 5 commits into
Conversation
Adds a Compress action alongside Uncompress (issue lab421#49, on the README roadmap). It zips the matched file or folder into <name>.zip next to it via ZIPFoundation's zipItem, numbering the archive when the name is taken (same "name (1).ext" convention as move/copy). The source stays in place, like a copy, and Undo is not offered — consistent with Uncompress. No options popover: an existing archive is always worked around by numbering, never skipped or replaced. Dry Run reports the archive path, including the rename, as a copied artifact.
…les without compression.
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #49.
What
Adds a Compress action alongside Uncompress — the first item on the README roadmap's "planned" list. It zips the matched file or folder into
<name>.zipnext to it.Behaviour:
<name>.zipis never overwritten or skipped — the new archive is numbered (report (1).zip), the same convention as Move/Copy conflicts. The existing archive is left untouched.hasOptions == false), perActionKind.hasOptions's design: the button hides entirely when there's nothing to configure. The issue's destination/timestamp options can layer on later asparamsif wanted — the schema makes that additive.Implementation
ActionKind.compressin the catalog (Models.swift), wired throughRuleSchema(label, icon, group, empty params) — the catalog's exhaustive switches guided every site.ActionExecutor.compressuses ZIPFoundation'sFileManager.zipItem(already a dependency via Uncompress) and the sharedresolveDestinationfor numbering; the Dry Runplancase reports the archive as acopiedPathartifact with a rename note when the name was taken.Three-path consistency (per AGENTS.md)
New action runs through the same
plan()/execute()machinery shared by Dry Run, Run Now, and the watcher — no path-specific code touched.Verification
swift buildclean.swift test: 333 tests in 28 suites, all passed (330 existing + 3 new).