Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

boa-cli crashes if history file does not exist #2223

Closed
RageKnify opened this issue Aug 6, 2022 · 0 comments
Closed

boa-cli crashes if history file does not exist #2223

RageKnify opened this issue Aug 6, 2022 · 0 comments
Labels
bug Something isn't working cli Issues and PRs related to the Boa command line interface. E-Easy Easy good first issue Good for newcomers
Milestone

Comments

@RageKnify
Copy link
Member

Describe the bug
boa_cli crashes when the .boa_history does not exist. I think this was introduced in #1809 with the rustyline update.

To Reproduce
In the project directory you can change .boa_history's name to .boa_history.bak and try to run cargo run, it will exit with "No such file or directory".

Expected behavior
The code below should be modified to create the history file if it doesn't exist yet. Not sure what is the best way to go about this but I expect rustyline to include this in its API.

boa/boa_cli/src/main.rs

Lines 218 to 221 in 3d6a8d5

editor.load_history(CLI_HISTORY).map_err(|err| match err {
ReadlineError::Io(e) => e,
e => io::Error::new(io::ErrorKind::Other, e),
})?;

@RageKnify RageKnify added bug Something isn't working good first issue Good for newcomers E-Easy Easy cli Issues and PRs related to the Boa command line interface. labels Aug 6, 2022
@Razican Razican added this to the v0.16.0 milestone Aug 21, 2022
@bors bors bot closed this as completed in 861b9a1 Aug 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working cli Issues and PRs related to the Boa command line interface. E-Easy Easy good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants