Create leading directories to the log file
(deno) yoh@typhon:/mnt/DATA/data/yoh/1076_spacetop$ duct deno run --allow-read --allow-env --reload -A https://github.com/bids-standard/bids-validator/raw/deno-build/bids-validator.js --outfile logs/deno-bids-validator.log $PWD
2025-01-28T16:13:33-0500 [INFO ] con-duct: duct is executing 'deno run --allow-read --allow-env --reload -A https://github.com/bids-standard/bids-validator/raw/deno-build/bids-validator.js --outfile logs/deno-bids-validator.log /mnt/DATA/data/yoh/1076_spacetop'...
2025-01-28T16:13:33-0500 [INFO ] con-duct: Log files will be written to .duct/logs/2025.01.28T16.13.33-3649011_
Download https://github.com/bids-standard/bids-validator/raw/deno-build/bids-validator.js
Download https://raw.githubusercontent.com/bids-standard/bids-validator/deno-build/bids-validator.js
error: Uncaught (in promise) NotFound: No such file or directory (os error 2): writefile 'logs/deno-bids-validator.log'
var ESCAPE = "\\";
^
at writeFileSync (ext:deno_fs/30_fs.js:899:3)
at Object.writeTextFileSync (ext:deno_fs/30_fs.js:962:10)
at main (https://raw.githubusercontent.com/bids-standard/bids-validator/deno-build/bids-validator.js:46:12)
at eventLoopTick (ext:core/01_core.js:168:7)
at async https://raw.githubusercontent.com/bids-standard/bids-validator/deno-build/bids-validator.js:3:16
2025-01-28T16:23:20-0500 [INFO ] con-duct: Summary:
Exit Code: 1
Command: deno run --allow-read --allow-env --reload -A https://github.com/bids-standard/bids-validator/raw/deno-build/bids-validator.js --outfile logs/deno-bids-validator.log /mnt/DATA/data/yoh/1076_spacetop
Log files location: .duct/logs/2025.01.28T16.13.33-3649011_
Wall Clock Time: 586.905 sec
Memory Peak Usage (RSS): 607.9 MB
Memory Average Usage (RSS): 529.4 MB
Virtual Memory Peak Usage (VSZ): 21.1 GB
Virtual Memory Average Usage (VSZ): 21.1 GB
Memory Peak Percentage: 0.0%
Memory Average Percentage: 0.0%
CPU Peak Usage: 100.0%
Average CPU Usage: 80.02024432809782%
so it took about 10 minutes to crash the process, since logs/ folder for --outfile path does not exist. I do not think it would be worthwhile to open the file earlier in the process, since process could just crash before getting anything output. But I think it would be nice if leading paths were automagically created.
Interested in getting your hands dirty?
https://github.com/bids-standard/bids-validator/blob/4e2978da655cdecad34b4ad45ebda58170702551/src/main.ts#L44-L46
https://jsr.io/@std/path/doc/~/dirname
https://docs.deno.com/api/deno/~/Deno.mkdir / https://docs.deno.com/api/deno/~/Deno.mkdirSync
Let me try indeed when I get a moment to add that line and be able to add a test ;-)