fix: add error message for file not found#227
fix: add error message for file not found#227Edythator wants to merge 3 commits intoelectron:mainfrom
Conversation
Add an error message when trying to locate a non-existing file inside an archive when using `extract-file`.
90d279b to
56e60b6
Compare
|
Tests seem to be failing, have you looked into what might be the cause of that? |
|
Seems like we need to update the xcode version for macOS CI to boot up. ref #223 |
malept
left a comment
There was a problem hiding this comment.
I'm OK with the spirit of the PR but not the implementation.
asaris first and foremost a library, not a CLI. As such, it cannotprocess.exitin the middle.- this needs tests so that any future changes don't regress the change.
Reworked the error handling to make it more "proper" as well as having added tests.
|
Hello, @malept. Sorry for not having understood the project's layout. I've now updated the branch in order to more accurately fit the requirements that this project needs. Please let me know if you have any further concerns. |
bin/asar.js
Outdated
| const fileData = asar.extractFile(archive, filename) | ||
| if (typeof fileData === 'undefined') { | ||
| console.error(`The file "${filename}" was not found in the archive.`) | ||
| return |
There was a problem hiding this comment.
This is in the CLI part of the repository, so it makes more sense here to process.exit(1)... although if an exception is thrown, the changes here probably aren't needed.
There was a problem hiding this comment.
This is in the CLI part of the repository, so it makes more sense here to
process.exit(1)... although if an exception is thrown, the changes here probably aren't needed.
Yeah, I couldn't really add a process.exit(1) to start with since that messes up the test.
Added an exception handler instead of relying on an if branch.
Add an error message when trying to locate a non-existing file inside an archive when using
extract-file.