如何将命令行参数传递给nps?

如何将参数从命令行传递到称为其他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,但我仍然不知道如何通过

iCMS 回答:如何将命令行参数传递给nps?

暂时没有好的解决方案,如果你有好的解决方案,请发邮件至:iooj@foxmail.com
本文链接:https://www.f2er.com/2144224.html

大家都在问