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

Crash when a input folder is empty #1199

Closed
Djabal opened this issue Jul 6, 2024 · 5 comments · Fixed by #1231
Closed

Crash when a input folder is empty #1199

Djabal opened this issue Jul 6, 2024 · 5 comments · Fixed by #1231
Assignees
Labels
enhancement New feature or request

Comments

@Djabal
Copy link

Djabal commented Jul 6, 2024

Paste the command

mkdir empty_dir
igir copy   --dat "./dat/any_dat.dat"  --input "./empty_dir/" --output "./bug_test/"
igir move   --dat "./dat/any_dat.dat"  --input "./empty_dir/" --output "./bug_test/"
igir link   --dat "./dat/any_dat.dat"  --input "./empty_dir/" --output "./bug_test/"

Describe the bug

Igir crash when the commands copy, link, move, clean, fixdat, dir2dat are used.

Expected behavior

Igir continue his job.

Debug logs

[13:29:03.015] TRACE: Parsing CLI arguments: copy --dat "./dat/Sega - 32X (Parent-Clone) (20231229-101939).dat" --input ./empty_dir/ --output ./bug_test/ -vvv
[13:29:03.017] TRACE: Parsed CLI options: {"_":["copy"],"fixdat":false,"input":["./empty_dir/"],"inputExclude":[],"inputMinChecksum":"CRC32","inputChecksumArchives":"auto","dat":["./dat/Sega - 32X (Parent-Clone) (20231229-101939).dat"],"datExclude":[],"datRegex":"","datNameRegex":"","datRegexExclude":"","datNameRegexExclude":"","datDescriptionRegex":"","datDescriptionRegexExclude":"","datCombine":false,"datIgnoreParentClone":false,"patch":[],"patchExclude":[],"output":"./bug_test/","dirMirror":false,"dirDatName":false,"dirDatDescription":false,"dirLetter":false,"dirLetterCount":1,"dirLetterLimit":0,"dirLetterGroup":false,"dirGameSubdir":"multiple","overwrite":false,"overwriteInvalid":false,"cleanExclude":[],"cleanDryRun":false,"zipExclude":"","zipDatName":false,"symlink":false,"symlinkRelative":false,"header":"","mergeRoms":"fullnonmerged","allowIncompleteSets":false,"filterRegex":"","filterRegexExclude":"","filterLanguage":[],"languageFilter":[],"filterRegion":[],"regionFilter":[],"noBios":false,"onlyBios":false,"noDevice":false,"onlyDevice":false,"noUnlicensed":false,"onlyUnlicensed":false,"onlyRetail":false,"noDebug":false,"onlyDebug":false,"noDemo":false,"onlyDemo":false,"noBeta":false,"onlyBeta":false,"noSample":false,"onlySample":false,"noPrototype":false,"onlyPrototype":false,"noProgram":false,"onlyProgram":false,"noAftermarket":false,"onlyAftermarket":false,"noHomebrew":false,"onlyHomebrew":false,"noUnverified":false,"onlyUnverified":false,"noBad":false,"onlyBad":false,"single":false,"preferGameRegex":"","preferRomRegex":"","preferVerified":false,"preferGood":false,"preferLanguage":[],"preferRegion":[],"preferRevisionNewer":false,"preferRevisionOlder":false,"preferRetail":false,"preferNtsc":false,"preferPal":false,"preferParent":false,"reportOutput":"./igir_%YYYY-%MM-%DDT%HH:%mm:%ss.csv","datThreads":3,"readerThreads":8,"writerThreads":4,"writeRetry":2,"tempDir":"/tmp/igir/20240706-132902","disableCache":false,"verbose":3,"help":false,"d":["./dat/Sega - 32X (Parent-Clone) (20231229-101939).dat"],"i":["./empty_dir/"],"o":"./bug_test/","v":3,"input-min-checksum":"CRC32","input-checksum-archives":"auto","dir-letter-count":1,"dir-game-subdir":"multiple","merge-roms":"fullnonmerged","report-output":"./igir_%YYYY-%MM-%DDT%HH:%mm:%ss.csv","dat-threads":3,"reader-threads":8,"writer-threads":4,"write-retry":2,"$0":"igir"}
[13:29:03.061] TRACE: loading the file cache at '/home/morgan/igir.cache'
[13:29:03.074] TRACE: DATScanner: scanning DAT files
[13:29:03.098] TRACE: DATScanner: found 1 DAT file
[13:29:03.114] TRACE: DATScanner: enumerating DAT archives
[13:29:03.123] TRACE: DATScanner: parsing 1 DAT file
[13:29:03.126] TRACE: DATScanner: dat/Sega - 32X (Parent-Clone) (20231229-101939).dat: attempting to parse 89.3KB of XML
[13:29:03.144] TRACE: DATScanner: dat/Sega - 32X (Parent-Clone) (20231229-101939).dat: parsed XML, deserializing to DAT
[13:29:03.176] TRACE: DATScanner: dat/Sega - 32X (Parent-Clone) (20231229-101939).dat: 575.8MB of 214 games, 53 parents parsed
[13:29:03.178] TRACE: DATScanner: done scanning DAT files
✓ Scanning for DATs ·········· | 1 DAT found
[13:29:03.189] TRACE: ROMScanner: scanning ROM files
↻ Scanning for ROMs ·········· | ░░░░░░░░░░░░░░░░░░░░░░░░░
↻ Scanning for ROMs ·········· | ░░░░░░░░░░░░░░░░░░░░░░░░░
 
[13:29:03.198] ERROR: ./empty_dir/: directory doesn't contain any files
[13:29:03.198] ERROR:     at Options.<anonymous> (file:///tmp/caxa/applications/igir/xhpuc4rlsc/0/dist/src/types/options.js:353:27)
[13:29:03.198] ERROR:     at Generator.next (<anonymous>)
[13:29:03.198] ERROR:     at fulfilled (file:///tmp/caxa/applications/igir/xhpuc4rlsc/0/dist/src/types/options.js:13:58)

DAT(s) used

any dat, i use No-Intro standard (2024-06-18)

igir version

v2.9.1

Node.js version

N/A

Operating system

Debian

Additional context

No response

@Djabal Djabal added the potential-bug A potential issue that needs confirmation and/or triage label Jul 6, 2024
@emmercm emmercm self-assigned this Jul 8, 2024
@emmercm
Copy link
Owner

emmercm commented Jul 8, 2024

This is expected and won't be changed. It does not make sense to continue processing if there is nothing to process.

@Djabal
Copy link
Author

Djabal commented Jul 9, 2024

Sorry I haven't given enough informations on the bug, I forget the most important things !
Igir stop/crash when one of the given input is empty.

mkdir empty
mkdir not_empty
touch not_empty/stub.rom
igir copy --dat "*.dat" --input "not_empty" --input "./empty/" --output "./bug_input_output/"

Thanks for your work !

@emmercm
Copy link
Owner

emmercm commented Jul 10, 2024

I'm still tempted to leave the behavior as-is, but I'm curious what your use case for this is?

@Djabal
Copy link
Author

Djabal commented Jul 14, 2024

I use igir mostly in scripts, so some time there's an empty input folder.
Example : --input "roms_gg" --input "roms_gg_to_import" --output "roms_gg"
But I haven't any roms the first time, so "roms_gg" is empty !

I ask igir to copy all roms it found in the inputs. Not to check if one of the folder is empty. And the folder is not empty, it just have zero roms inside, so why stop ?

Ty !

@emmercm emmercm reopened this Jul 22, 2024
@emmercm emmercm added enhancement New feature or request and removed potential-bug A potential issue that needs confirmation and/or triage labels Jul 22, 2024
Copy link

🔒 Inactive issue lock

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

Comment generated by the GitHub Lock Issues workflow.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 22, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants