Closed ariskataoka closed 1 month ago
✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.
Package | Version | Score | Details |
---|
When I accidently applied this command to an archive file, it failed ungracefully
→ node ./dist/bin/vip-import-validate-files.js @2786.production ~/Downloads/wp-content.tar.gz
✕ Error: Cannot read nested directory: /Users/saroshaga/Downloads/wp-content.tar.gz. Reason: ENOTDIR: not a directory, scandir '/Users/saroshaga/Downloads/wp-content.tar.gz'
✕ Please contact VIP Support with the following information:
TypeError: Cannot destructure property 'files' of 'nestedFiles' as it is undefined.
at /Users/saroshaga/Projects/Automattic/vip/dist/bin/vip-import-validate-files.js:67:5
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async _args.default.argv (/Users/saroshaga/Projects/Automattic/vip/dist/lib/cli/command.js:444:11)
Error: Unexpected error
Debug: VIP-CLI v3.5.1-dev.0, Node v18.20.2, darwin 23.5.0 x64
Maybe we should fail gracefully if a directory is not detected at the start. Can do this in a separate PR too!
When I accidently applied this command to an archive file, it failed ungracefully ... Maybe we should fail gracefully if a directory is not detected at the start. Can do this in a separate PR too!
Good finding! Gonna raise a different PR for that one.
Issues
0 New issues
0 Accepted issues
Measures
0 Security Hotspots
0.0% Coverage on New Code
0.0% Duplication on New Code
Description
While maintaining previous validations, such as folder structure, this PR updates the media file validation implementation. The configuration for these validations will originate from the public API.
Pull request checklist
New release checklist
Test
Data
The uploads folder should contain files with invalid types/extensions, large files (more than 2GB), and files with long names (more than 255 chars).
Steps
Check out PR.
Run
npm run build
Login with a valid token
node ./dist/bin/vip login
Run
node ./dist/bin/vip-import-validate-files.js <MY_FOLDER_NAME>
to trigger the validation for the content within a specific folderVerify the validation result