如何使用npm脚本使用自定义提交消息推送到github?

rel*_*don 5 git node.js npm npm-scripts

在我,package.json我有这个

  "scripts": {
    "start": "gulp serve",
    "git": "git add . && git commit -m 'some-message' && git push --all"
  },
Run Code Online (Sandbox Code Playgroud)

在我运行的终端npm run git中,推送更改.但是如何动态更改提交消息?例如npm run git MESSAGE='another commit'

And*_*aro 11

涉及一些npm技巧的解决方案可能包括:

"scripts": {
  "git": "git add . && git commit -m",
  "postgit": "git push --all"
},
Run Code Online (Sandbox Code Playgroud)

被称为:

npm run git -- "Message of the commit"
Run Code Online (Sandbox Code Playgroud)

要么:

npm run git -- Message
Run Code Online (Sandbox Code Playgroud)