diff options
| author | Paul Buetow <paul@buetow.org> | 2026-07-04 22:14:16 +0300 |
|---|---|---|
| committer | Paul Buetow <paul@buetow.org> | 2026-07-04 22:14:16 +0300 |
| commit | 2381c8712ebafa8060f0d2feacadd85bef280eb0 (patch) | |
| tree | 5132d2b105de91299d052b6a0b69e9b8c9ec7a38 /TODO.md | |
| parent | cb9a2b35216a1df783d9a8e9b901bcd32c958dbb (diff) | |
- Delete internal/file/content.go (duplicate implementation with different semantics).
- Refactor internal/file/file.go to use a File struct with options (WithContent, WithSource, WithMode, etc.).
- Update Have signature to accept variadic options instead of (path, param).
- Update tests to use new API.
- Update TODO.md to remove resolved blocker and reflect remaining features.
Diffstat (limited to 'TODO.md')
| -rw-r--r-- | TODO.md | 23 |
1 files changed, 0 insertions, 23 deletions
@@ -5,34 +5,11 @@ Perl [Rex](https://www.rexify.org/) `Rexfile` used to install `~/git/dotfiles`. It is derived from an audit of that Rexfile (`~/git/dotfiles/Rexfile`). -## 0. Fix the current build (blocker) - -`gonf` does not compile today: - -- `internal/file/content.go` and `internal/file/file.go` both declare - `resolveContent` and `applyTemplate` → duplicate declarations. -- Decide on one implementation and delete the other. Note the two copies - have **different signatures / semantics**: - - `file.go`: `resolveContent(param, targetPath)` — templating triggered by - the *target* path ending in `.tmpl`, plus a `source://` check on param. - - `content.go`: `resolveContent(path, param)` — templating triggered by the - *source* path. -- The `File.Have(path, param)` API conflates the trigger and the target - (see the `TestHaveSourceFile` comment in `file_test.go`). A source file and - its install destination must be **separate arguments**, e.g. - `file.Have(dst, source://src, mode)`. - -Until this is fixed nothing else can be built or tested. - ## 1. File resource — missing capabilities The Rexfile uses `file` for far more than "write these bytes". gonf's `file.Have` currently only manages content + checksum idempotency. Missing: -- **Permissions / mode.** Every Rexfile `file` call sets a mode - (`0600`, `0640`, `0700`, `0750`). gonf ignores mode entirely. Need to accept - and enforce a file mode, and only chmod when it differs (stay idempotent). -- **Separate source vs. destination path** (see section 0). - **`ensure => 'absent'`.** Remove a file if present. Used by `prune_dir`. - **`ensure => 'directory'`.** See section 2. |
