Automattic / vip-cli

The VIP-CLI
https://docs.wpvip.com/vip-cli/
MIT License
58 stars 17 forks source link

fix(import-media): Display success/total count even if all files fail to import #2012

Closed aswasif007 closed 2 months ago

aswasif007 commented 2 months ago

Issue

https://github.com/Automattic/vip-cli/issues/2005

Description

In the vip import media command, when all files in the archive fails/errors while importing, the import does not show the success/total count in the end. This is because of a bug in the null-check filter where the case of filesProcessed = 0 is being consumed by the null check.

Pull request checklist

Steps to Test

  1. Check out PR.
  2. Run npm run build
  3. Run node ./dist/bin/vip import media @<app>.<env> https://getsamplefiles.com/download/zip/sample-1.zip twice. In the second run, all the files should fail to import as they are already imported. When that happens, make sure that the Imported Files: 0/4 - 0% ✓ line is present in the output.
github-actions[bot] commented 2 months ago

Dependency Review

✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.

OpenSSF Scorecard

PackageVersionScoreDetails

Scanned Manifest Files

sonarcloud[bot] commented 2 months ago

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
0.0% Coverage on New Code
0.0% Duplication on New Code

See analysis details on SonarCloud