Fix error when merging a single archive #1218
Open
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.
Bug/issue #, if applicable:
Summary
Currently, when trying to merge a single doccarchive that contains either only references or only tutorials, the command fails because it tries to read from a directory that does not exist (e.g.
tutorials
in case of a reference-only archive).While this is a rather special use case, the action basically supports it (except for this error) and we use it to have a unified documentation setup for our packages by generating the doccarchive for each target and then merging them together. For multi-target packages this works fine, but for single-target packages it currently fails.
This fixes the source of this error. Alongside, I've also added a small check to not create directories that are not needed - even when merging multiple archives. With that check, merging two reference-only archives will not create an empty
tutorials
directory.Dependencies
None
Testing
Steps:
doccarchive
(with only tutorials or references)docs merge /path/to/archive.doccarchive --output-path ./combined.doccarchive
Checklist
Make sure you check off the following items. If they cannot be completed, provide a reason.
./bin/test
script and it succeeded