5 Commits
Author SHA1 Message Date
Willie f5a5e920c8 fix(config): allow project configs at a volume root
The containment check appended a separator to the project root. For a
project at / or C:\ the root already ends with one, so the prefix became
// or C:\\ and every save of that project's config was refused as
linking outside the project.
2026-10-07 10:54:06 +08:00
Willie 1f277af118 fix(config): resolve the whole path before checking project containment
ConfigWritePath followed only one hop of a dangling link and resolved
only an existing parent directory. A project link to an in-project
link pointing outside, or to a missing file under an in-project
directory link that leaves the project, passed the containment check,
and the save then wrote or created the file outside the project.

Follow every link of a dangling chain, with a hop limit, and resolve
symlinks in the longest existing prefix of each path so a missing
directory cannot hide an escaping link above it.
2026-10-07 10:28:32 +08:00
Willie f4c77d53c3 fix(config): refuse project config writes that leave the project
Saves follow a symlinked config.yaml to its target so dotfile links
survive. For a project config that also lets a cloned repository point
.skillshare/config.yaml at any file the user can write, including one
that does not exist yet, and every project save, plugin change, hooks
change, MCP change, or legacy migration would then rewrite or create it.

All five writers now resolve the destination through one helper,
utils.ConfigWritePath. A global config keeps writing through its link.
A project config must resolve inside its project; otherwise the save
fails and names the link so the user can replace it with a regular
file. The one-time legacy migration skips persisting instead, and the
next save reports the link.
2026-10-07 10:19:12 +08:00
Willie 3b2f062cf0 docs: add v0.19.11 changelog, preserve_tilde_on_save docs, fix CI test
- Add changelog entry for v0.19.11 (preserve_tilde_on_save, backups gitignore)
- Document preserve_tilde_on_save in configuration reference, cross-machine sync, FAQ
- Fix TestFoldHomePath/unrelated-abs: use /opt/unrelated/foo instead of /tmp/foo (CI sets HOME=/tmp)
- Add iFwu to README contributors
2026-05-14 13:22:23 +08:00
iFwu 5403595120 feat(config): preserve ~ in saved config paths (opt-in)
Add PreserveTildeOnSave config flag (default false). When enabled, the
Save path folds $HOME prefixes back to ~ when serializing the in-memory
Config to YAML so the on-disk config stays portable across machines
(e.g. when shared via dotfiles).

The in-memory Config is left untouched; cloneForSave() produces a
shallow copy with path fields rewritten. Mirrors the existing
expandPath() calls performed in Load():
  - cfg.Source, cfg.ExtrasSource
  - cfg.Targets[*].Path / Skills.Path / Agents.Path
  - cfg.Extras[*].Source and Extras[*].Targets[*].Path

Adds:
  - utils.FoldHomePath() helper with unit tests (exact-home, child,
    sibling-non-home, unrelated-abs, relative, Windows case-insensitive)
  - 3 Save-path tests covering default-off, fold-on, and Load→Save
    idempotency.

Default off keeps the change backward compatible: existing users see no
behavior difference. Users who share their config via dotfiles can opt
in with:

    preserve_tilde_on_save: true
2026-05-14 13:09:56 +08:00