Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我想实施一个 husky 规则以使其运行yarn build并确保将要推送的内容不会破坏应用程序。
yarn build
我浏览了网页,但仍然不确定以下方法是否正确?
"husky": { "hooks": { "pre-commit": "cross-env lint-staged", "pre-push": "cross-env lint-staged yarn build" } },
分配给pre-commit并且pre-push应该是命令的值,就好像它们是直接从命令行运行一样。在这种情况下cross-env lint-staged yarn build,将在推送之前作为一个命令运行。(没有用过纱线,所以我不确定这是否正确。)
pre-commit
pre-push
cross-env lint-staged yarn build
多个命令可以链接在一起,如下所示:
"pre-commit": "command1 arg1 arg2 && command2"