如何将参数从命令行传递到称为其他nps脚本的nps脚本?我知道我可以通过nps "script arg"
将参数传递给nps脚本,但是我想执行类似./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
现在我想设置nps
,但如何使nps从命令行读取参数?因此,当我致电./pnpm start test file_path
时,它可以执行xxx run --spec file
#package-scripts.yaml
test:
default: nps test.unit #?
unit: xxx run --spec '@?' #?
我可以找到的封闭公关是https://github.com/sezna/nps/issues/133#issuecomment-301915698,但我仍然不知道如何通过