Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/git/24.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
从提交后git钩子运行grunt_Git_Gruntjs_Screeps - Fatal编程技术网

从提交后git钩子运行grunt

从提交后git钩子运行grunt,git,gruntjs,screeps,Git,Gruntjs,Screeps,每次使用GitHub桌面创建新提交时,我都会尝试在我的GitHub存储库文件夹中运行控制台命令“grunt”(这是将GitHub存储库的代码链接到我的Screeps帐户) 我在.git/hooks“post-commit”中创建了一个新文件,其代码如下: #!/bin/sh exec node -e "require('grunt').cli();" 如何在每次提交时自动运行Grunt?在我的环境中,我从命令行运行: node -e "require('grunt').cli();" 它发

每次使用GitHub桌面创建新提交时,我都会尝试在我的GitHub存储库文件夹中运行控制台命令“grunt”(这是将GitHub存储库的代码链接到我的Screeps帐户)

我在.git/hooks“post-commit”中创建了一个新文件,其代码如下:

#!/bin/sh

exec node -e "require('grunt').cli();"

如何在每次提交时自动运行Grunt?

在我的环境中,我从命令行运行:

node -e "require('grunt').cli();"
它发出咕噜声,做了通常的提交,所以部分脚本是正确的

可能您的钩子脚本找不到节点。它是全球安装的吗?是否需要激活节点环境