Repository navigation
feat: date tokens in Move/Copy destination paths - #80
Merged
Merged
Conversation
Adds {year}, {month}, and {day} tokens (month/day zero-padded) to the
destination of Move to folder and Copy to folder, resolved from each
file's creation date (falling back to modification date), so workflows
like ~/Archive/{year}/{month} need no script. Unknown {...} sequences
are left as-is. Tokens are expanded in both the Dry Run plan and
execution, so previews show the real resolved path and the
already-in-destination no-op compares against it.
The destination field becomes an editable text field (same pattern as
the app path pickers) so a tokened path can be typed; the Choose…
button is unchanged.
Closes lab421#34
Collaborator
|
@prismatic7 Thanks ! I added a small helper |
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 #34. Also answers the follow-up requests in that thread (
~/Screenshots/{year}/{month}), and it's the first item under "Dynamic destination folders with date tokens" on the README roadmap.What
Move to folderandCopy to folderdestinations now accept{year},{month}, and{day}tokens, expanded per file before the move/copy — so a monthly-download-archive rule is just a destination like~/Downloads/Backup/{year}-{month}.07,05); unknown{...}sequences are left untouched, so a folder legitimately namedKeep {literal}still works alongside tokens.Already in destinationno-op check compares against the resolved folder.moveIntoDiralready creates intermediates).AppPickerField/ApplicationPathPickerFieldalready use ("stays a plain text field underneath so … can still be typed manually"). Without this, a tokened path could not be entered at all, since the field was picker-only.Three-path consistency (per AGENTS.md)
Expansion happens where the destination param is read, shared by Dry Run planning and execution; the watcher path runs through the same
plan()/execute()machinery. No path-specific code touched.Verification
swift buildclean.swift test: 332 tests in 28 suites, all passed (329 existing + 3 new).{year}/{month}-{day}(plan + execute against a fixed creation date), copy with{year}/{month}(source kept), unknown-brace destination left alone.FolderFieldrendering; no GUI run locally.