15 ms·
Looks good, will consider it next time I need to create a complex shell script. For creating cross-platform scripts in package.json I've settled on shx [1]. [1
by mythz 3y ago
Looks good, will consider it next time I need to create a complex shell script.
For creating cross-platform scripts in package.json I've settled on shx [1].
[1] https://www.npmjs.com/package/shx https://www.npmjs.com/package/shx
- notpushkin 3y agoMaybe give bsx a try instead? (disclaimer: I'm the maintainer) pnpm add --dev bsx { "scripts": {"cleanup": "bsx rm -rf some-cache"} } https://npm.im/bsx https://npm.im/bsx This would use busybox-w32 on Windows, and regular shell on other platforms. You do have your usual footguns like some *nixes not having some tools installed out of the box, but for the 95% cases this should be fine and it's only 536 kB (vs 1.5M for shx)!