Skip to content

Fix output path not validated before the run#2148

Merged
mre merged 3 commits into
lycheeverse:masterfrom
kvasi34:fix/validate-output-path-before-run
Apr 19, 2026
Merged

Fix output path not validated before the run#2148
mre merged 3 commits into
lycheeverse:masterfrom
kvasi34:fix/validate-output-path-before-run

Conversation

@kvasi34

@kvasi34 kvasi34 commented Apr 16, 2026

Copy link
Copy Markdown
Contributor
  • Added check before execution, ensuring that the parent of the given output path exists
  • Added test for the new logic

The already existing behavior is kept, the only difference being that the checks do not run if the parent directory of the output path does not exist.

lychee --output tmp.txt https://example.com succeeds even if tmp.txt does not exist (just like before).
lychee --output does/not/exist/tmp.txt https://example.com now fails before checks, since directory does/not/exist/ does not exists.

Note: also affects --dump.

Closes #2147

Comment thread lychee-bin/tests/cli.rs
Comment thread lychee-bin/src/main.rs
@mre

mre commented Apr 17, 2026

Copy link
Copy Markdown
Member

Thanks for the PR, Kostas. Two minor remarks from my side.

@kvasi34

kvasi34 commented Apr 17, 2026

Copy link
Copy Markdown
Contributor Author

Thanks for your input @mre ! I have added the changes you proposed.

@kvasi34 kvasi34 requested a review from mre April 19, 2026 05:17
@mre mre merged commit d118354 into lycheeverse:master Apr 19, 2026
7 checks passed
@mre

mre commented Apr 19, 2026

Copy link
Copy Markdown
Member

Thanks a lot for the nice contribution. 😃

@mre mre mentioned this pull request Apr 17, 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.

Output path not validated before the run

2 participants