Skip to content

fix: resolve relative output path in preset export#739

Merged
Lightheartdevs merged 1 commit intoLight-Heart-Labs:mainfrom
yasinBursali:fix/preset-export-relative-path
Apr 3, 2026
Merged

fix: resolve relative output path in preset export#739
Lightheartdevs merged 1 commit intoLight-Heart-Labs:mainfrom
yasinBursali:fix/preset-export-relative-path

Conversation

@yasinBursali
Copy link
Copy Markdown
Contributor

What

Fix dream preset export creating archive in wrong directory when given relative path.

Why

The command does cd "$PRESETS_DIR" before tar czf "$output", so relative output paths resolve against PRESETS_DIR instead of the user's working directory.

How

Resolve relative paths to absolute before the cd:

if [[ "$output" != /* ]]; then
    output="$(pwd)/$output"
fi

Testing

  • bash -n syntax check passes
  • POSIX/BSD compatible (no realpath, just pwd + string check)
  • Manual: dream preset export mypreset ./backup.tar.gz now creates file in CWD

Review

Critique Guardian: APPROVED

  • Noted pre-existing identical bug in dream preset import — separate issue.

Platform Impact

  • macOS: pwd is POSIX builtin, works identically
  • Linux: Same
  • Windows/WSL2: Same

Note: This PR touches dream-cli which is also modified by #734. Rebase needed after #734 merges.

🤖 Generated with Claude Code

The preset export command changes directory to $PRESETS_DIR before
running tar. If the user provides a relative output path, the archive
is created relative to PRESETS_DIR instead of the user's working
directory. Now resolves relative paths to absolute before the cd.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@Lightheartdevs Lightheartdevs merged commit add6611 into Light-Heart-Labs:main Apr 3, 2026
19 of 27 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants