Repository navigation
Open the HTML report without a shell - #4912
Merged
Merged
Conversation
--open built a shell command by joining strings, so it failed when the result path had spaces, and the shell would interpret special characters in the path. Use execFileSync with the path as an argument instead. Fixes sitespeedio#4911 Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Member
|
Thank you @gkirat20 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Use execFileSync with the path as an argument when opening the report with --open, so paths with spaces work and nothing in the path is interpreted by a shell.
Fixes #4911
Tested manually on macOS:
sitespeed.io https://www.sitespeed.io -n 1 --outputFolder "$HOME/my results/test" --open
Before: "The files /Users/kirat/my and /Users/kirat/Desktop/sitespeed.io/results/test/index.html do not exist."
After: the report opens in the browser.
npm test: all tests pass except "cliTests › CLI should silently ignore the removed summary boxes options", which doesn't touch the --open code path (I'm on Node 20, so it may be a version difference). No unit test added, since the change is in the CLI entry script.
This pull request was made with assistance from Claude.