Skip to content

Config path values are not tilde- or environment-expanded #80

Closed

Description

@jamesainslie

Surfaced during the 2026-07-27 documentation audit; verified empirically against a built binary.

directories.package, directories.target, symlinks.backup_dir, and logging.file are stored literally and resolved against the working directory. A config containing target: /tildetest plans 'Create directory: //tildetest/p1', and target: $HOME plans '/$HOME/p1'; both create a literal directory named '' or '$HOME' under the current directory. Only pkg/dot/adopt_service.go:94 expands '', and only for adopt arguments. 'target: ' alone appears to work only because bare '' is YAML null, so the default applies.

Consequence: a repository config that pins directories with ~ or $HOME silently mislocates every operation, and the same config cannot be portable across machines without absolute paths.

Suggested fix: expand a leading ~ and environment variables when loading path-typed config values (directories.*, symlinks.backup_dir, logging.file). Docs were updated to use absolute paths and state the current rule.

Activity

  1. jamesainslie commented on Aug 12, 2026

    @jamesainslie
    CollaboratorAuthor

    Fixed by #89 (it referenced this issue but did not auto-close). Verified 2026-08-12 against a binary built from main at cbbe8df, in a sandboxed HOME with a config containing directories.package: $VAR/repo, directories.target: ~/tildetest, and logging.file: ~/logs/dot.log:

    • all three expand to absolute paths under the sandbox home (config get shows the expanded values; expansion covers directories.*, symlinks.backup_dir, and logging.file via ExpandPaths)
    • an undefined variable is a loud, named error rather than a silent root-anchored path: "expand config paths: directories.package: undefined environment variable $DOTPKG_ROOT in "$DOTPKG_ROOT/repo""

    The fix ships in the next release (currently staged as v0.7.0 in #83).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions