jac*_*118 5 node-modules package.json pnpm nps
如何将参数从命令行传递到称为其他 nps 脚本的 nps 脚本?我知道我可以将参数传递给 nps 脚本,nps "script arg"但我想执行命令行,就像./pnpm start test.unit file_path实际执行一样./node_modules/xxx/bin/xxx run --spec file_path
到目前为止,如果我按如下方式设置 package.json 我可以通过./pnpm run test file_path==得到我想要的xxx run --spec file_path
#package.json
"scripts": {
"start": "nps",
"test": "xxx run --spec"
},
./pnpm run test file_path
Run Code Online (Sandbox Code Playgroud)
现在我想设置,nps但如何让 nps 从命令行读取参数?所以当我调用./pnpm start test file_path它时可以执行xxx run --spec file
#package-scripts.yaml
test:
default: nps test.unit #?
unit: xxx run --spec '@?' #?
Run Code Online (Sandbox Code Playgroud)
我能找到的封闭 PR 是https://github.com/sezna/nps/issues/133#issuecomment-301915698但我仍然不明白如何通过它
| 归档时间: |
|
| 查看次数: |
478 次 |
| 最近记录: |