LinusU / node-appdmg

💾 Generate your app dmgs
MIT License
1.68k stars 152 forks source link

Use Node's fs.copyFile, if available. #173

Closed argv-minus-one closed 5 years ago

argv-minus-one commented 5 years ago

cp-file doesn't seem to work on my system (macOS 10.14.4, Node 11.5.0 from Homebrew). It either throws an error (and trying to get the stack from that error results in another error being thrown!), or silently fails.

Node's fs.copyFile has no such problem. It's not available before Node 8.5.0, and appdmg targets Node ≥ 4, so this PR changes the code so that fs.copyFile is used if it is available, and if not, cp-file is used as a fallback.

LinusU commented 5 years ago

Fixed in 🚢 0.6.0

LinusU commented 5 years ago

(since we dropped support for Node.js < 8.5.0, we can always use fs.copyFile now)