Python 通过Bash检测Jasmine是否失败

Python 通过Bash检测Jasmine是否失败,python,node.js,bash,gruntjs,karma-jasmine,Python,Node.js,Bash,Gruntjs,Karma Jasmine,我正在我的web应用程序中运行Jasmine测试,我想创建一个bash脚本来运行测试,并在没有失败的情况下将当前代码推送到远程git存储库。除了我不知道测试是成功还是失败之外,一切都是超级重复。我怎么做?如果在bash中无法实现,我可以在python或nodejs中实现 我希望代码如下所示: #!/bin/bash succeeded=$(grunt test -no_output) #or some thing like it if[ succeeded = 'True'] than

我正在我的web应用程序中运行Jasmine测试,我想创建一个bash脚本来运行测试,并在没有失败的情况下将当前代码推送到远程git存储库。除了我不知道测试是成功还是失败之外,一切都是超级重复。我怎么做?如果在bash中无法实现,我可以在python或nodejs中实现

我希望代码如下所示:

#!/bin/bash
succeeded=$(grunt test -no_output) #or some thing like it

if[ succeeded = 'True'] than
    git push origin master
fi

运行命令,然后查看
$?
。例如:

if [ $? -eq 0 ]
then
  echo "Successfully created file"
else
 echo "Could not create file" >&2
fi

运行命令,然后查看
$?
。例如:

if [ $? -eq 0 ]
then
  echo "Successfully created file"
else
 echo "Could not create file" >&2
fi

运行命令,然后查看
$?
。例如:

if [ $? -eq 0 ]
then
  echo "Successfully created file"
else
 echo "Could not create file" >&2
fi

运行命令,然后查看
$?
。例如:

if [ $? -eq 0 ]
then
  echo "Successfully created file"
else
 echo "Could not create file" >&2
fi
它似乎指示任务是否成功。您可以使用此选项确定是否推送:

if grunt test -no_output; then
    git push origin master
fi
这将测试grunt的0(成功)退出代码,并在收到退出代码时推送。

它似乎指示任务是否成功。您可以使用此选项确定是否推送:

if grunt test -no_output; then
    git push origin master
fi
这将测试grunt的0(成功)退出代码,并在收到退出代码时推送。

它似乎指示任务是否成功。您可以使用此选项确定是否推送:

if grunt test -no_output; then
    git push origin master
fi
这将测试grunt的0(成功)退出代码,并在收到退出代码时推送。

它似乎指示任务是否成功。您可以使用此选项确定是否推送:

if grunt test -no_output; then
    git push origin master
fi
这将测试grunt的0(成功)退出代码,并在收到退出代码时推送