Closed erickzhao closed 3 months ago
Merging #133 (d9354ee) into main (29e44a6) will not change coverage. The diff coverage is
100.00%
.:exclamation: Current head d9354ee differs from pull request most recent head 3f0503b. Consider uploading reports for the commit 3f0503b to get more accurate results
@@ Coverage Diff @@
## main #133 +/- ##
=======================================
Coverage 75.43% 75.43%
=======================================
Files 1 1
Lines 57 57
=======================================
Hits 43 43
Misses 14 14
Impacted Files | Coverage Δ | |
---|---|---|
src/index.js | 75.43% <100.00%> (ø) |
Continue to review full report at Codecov.
Legend - Click here to learn more
Δ = absolute <relative> (impact)
,ø = not affected
,? = missing data
Powered by Codecov. Last update 29e44a6...3f0503b. Read the comment docs.
fs.rm
doesn't exist until Node 14, I think?I came across a deprecation warning (node:88445) [DEP0147] DeprecationWarning: In future versions of Node.js, fs.rmdir(path, { recursive: true }) will be removed. Use fs.rm(path, { recursive: true }) instead
while trying to build darwin DMGs for my Electron app.
fsPromises.rm
was added since 14.14.0 update. A check for the runtime node version using process.versions.node
can be used to select the correct method
const nodeVersion = process.versions.node.split('.').map(segment => parseInt(segment));
await (nodeVersion[0] > 14 || (nodeVersion[0] === 14 && nodeVersion[1] >= 14) ?
fs.rm :
fs.rmdir)(specDir, { recursive: true, maxRetries: 2 });
NOTE: fsPromises.rmdir
was added in v10.0.0, recursive
was added since v12.10.0
Will merge this after https://github.com/electron-userland/electron-installer-dmg/pull/178
Node 16: https://nodejs.org/api/deprecations.html#DEP0147