Skip to content

fix(cli): support '-' for stdin in backup restore#699

Open
Juqsi wants to merge 1 commit into
authzed:mainfrom
Juqsi:fix/restore-stdin-dash
Open

fix(cli): support '-' for stdin in backup restore#699
Juqsi wants to merge 1 commit into
authzed:mainfrom
Juqsi:fix/restore-stdin-dash

Conversation

@Juqsi

@Juqsi Juqsi commented Jun 11, 2026

Copy link
Copy Markdown

Description

zed backup restore - currently fails with unable to stat restore file: stat -: no such file or directory because the code attempts to call os.Stat() on the literal "-" string.

This PR adds standard Unix - shorthand support for stdin, aligning the behavior with zed backup create - (implemented in #688). openRestoreFile now treats filename == "-" identically to filename == "", returning os.Stdin directly.

Testing

  • Added table-driven unit test TestOpenRestoreFile in backup_test.go covering "", -, valid file paths, and invalid file errors
  • Manually verified via: cat backup.zed | zed backup restore -

References

Signed-off-by: Juqsi <91261422+Juqsi@users.noreply.github.com>
@github-actions

github-actions Bot commented Jun 11, 2026

Copy link
Copy Markdown

CLA Assistant Lite bot All contributors have signed the CLA ✍️ ✅

@Juqsi

Juqsi commented Jun 11, 2026

Copy link
Copy Markdown
Author

I have read the CLA Document and I hereby sign the CLA

@Juqsi

Juqsi commented Jun 11, 2026

Copy link
Copy Markdown
Author

recheck

authzedbot added a commit to authzed/cla that referenced this pull request Jun 11, 2026
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.

zed backup restore fails when using '-' for stdin

1 participant