Repository navigation
Exit 1 and name the skipped subfolders when the input has nothing to process [patch] - #178
Open
matt-edmondson wants to merge 1 commit into
Open
matt-edmondson wants to merge 1 commit into
matt-edmondson wants to merge 1 commit into
Conversation
…process [patch] Only the top level of --input is read, so an input folder whose images all sit in subfolders printed "Done. 0 file(s) written." and exited 0. A build script read that as success. A run that writes nothing and fails nothing now prints a warning that names the subfolders it did not read and exits with the invalid-arguments code. The README now says only the top level is read. Fixes #176 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017vfJW5GEJNk1TZFgDdUPFX
Contributor
Author
|
The Test jobs fail at restore with Generated by Claude Code |
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.
Fixes #176
What
ProcessDirectoryreads only the top level of--input. When every image sits in a subfolder, as inicons/ui/*.pngwith--input icons, the run printedDone. 0 file(s) written.and exited 0, so a build script took it as success.Executenow handles a batch that wrote nothing and failed nothing before it reachesExitCodeFor:Warning: no files to process in <input>. Only the top level of the input folder is read. Skipped subfolders: actions, ui.Dot-folders such as.gitare not listed.ExitInvalidArguments(1), the code the issue suggested. The problem is a wrong--input, so it is a bad-arguments case, not a failed batch.ExitCodeFor(new BatchResult(0, 0))still returns 0, because it only maps a batch that ran. I updated that test's comment to point to the new check. The README's Features, Exit Codes and Notes sections now say that only the top level is read, and CLAUDE.md's exit-code section describes the new case.I left the optional
--recursiveflag out to keep this PR small. It can be its own issue if it's wanted.Tests (
ProcessDirectoryTests)AnInputWhoseImagesAllSitInSubfoldersExitsNonZeroAndNamesThem: the input has onlyui/andactions/subfolders.Executemust return 1, write nothing, and the warning must list both subfolders.DescribeEmptyInputSaysOnlyTheTopLevelIsReadWhenThereAreNoSubfolders: with no subfolders, or only a dot-folder, the warning has no subfolder list.I disabled the new check temporarily and the first test failed. It passes with the check. The full suite passed 90 of 90, three runs in a row. The test checks the warning through
DescribeEmptyInputrather than by capturingConsole.Out, because the tests run in parallel and capturing the console was flaky.Note
As in #177, restore fails locally with
NU1903(the advisory onSixLabors.ImageSharp3.1.12), so I built with-p:NuGetAudit=false. That is not part of this change.Generated by Claude Code