如何将postinstall
脚本限制为仅在 macOS 上运行?
我的 React 本机库中有一个 shell 脚本,需要在 npm 安装完成后启动它。
这很好用,postinstall
但问题是 Windows 无法执行 shell 脚本。
"scripts": {
"postinstall": "./iospatch.sh"
},
我需要一种方法来限制它,只在 macOS 上运行。
我尝试使用这个库,但它不适用于我的情况 https://www.npmjs.com/package/cross-os