Repository navigation
fix(embed, normalize): an output in a folder that does not exist is refused by name (#290) - #291
Merged
Merged
Conversation
…efused by name (#290) `h5p-embed --scorm quiz.h5p missing/out.zip` ended in an uncaught ENOENT with a stack trace, after the whole zip had been planned, and `h5p-normalize -o missing/out.h5p` blamed h5p.json. Both now check the folder before any work and say which folder is missing.
Contributor
There was a problem hiding this comment.
All reported issues were addressed across 4 files
Reply with feedback, questions, or to request a fix.
View guided diff | Turn on auto-fix | Re-trigger cubic
…e, apart from a missing one (#290)
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.
Closes #290.
An output named in a folder that does not exist is now refused by name, before any work.
h5p-embed --scorm(buildScorm): it ended in an uncaughtENOENTwith a stack trace, after the whole zip had been planned. It now exits 1 withNo such folder: <folder>. Create it, or name a zip in a folder that exists.h5p-normalize -o(normalizeArchive): it exited witherror: h5p.json: ENOENT …, blaming an entry. It now names the folder, before the source is opened.h5p-author buildandbundlealready refused such an output, andh5p-embed <folder>andh5p-author readcreate their folder; those are unchanged.Tested
packages/embed/tests/scorm.test.ts: 38 of 38, with the new case (refused as anEmbedError, and the folder is not created).packages/normalize/tests/normalize.test.ts: 12 of 12, with the new case.Patch releases of
h5p-embedandh5p-normalizewhen the next release goes out.Summary by cubic
h5p-embed --scormandh5p-normalize -onow refuse an output whose folder does not exist or is a file, before any work starts.Previously,
h5p-embed --scormcrashed with an uncaughtENOENTstack trace after planning the whole zip, andh5p-normalizeblamed an entry for a mid-write failure. Both now exit 1 withNo such folder: <folder>.or<folder> is a file, not a folder.h5p-author buildandbundlealready refused such outputs, andh5p-embed <folder>andh5p-author readcreate the folder, so those are unchanged. The fix ships in the next patch releases ofh5p-embedandh5p-normalize.Written for commit e3c76b2. Summary will update on new commits.