【问题标题】:TortoiseSVN Client/Grunt: Hook a grunt task to TortoiseSVN clientTortoiseSVN 客户端/Grunt:将一个 grunt 任务挂接到 TortoiseSVN 客户端
【发布时间】:2015-02-20 08:48:25
【问题描述】:

是否可以在 TortoiseSVN 客户端挂接 Grunt 任务?在我们由 Grunt 管理的 UI 项目中,我们希望将一些 Grunt 任务(例如 Jslint、代码格式化程序等)与 TortoiseSVN 提交操作挂钩。

这个想法是为了防止对不健康的代码进行提交操作。

【问题讨论】:

标签: gruntjs tortoisesvn


【解决方案1】:

你应该看看 pre-commit 钩子。

您的 Subversion 存储库已经有一些模板挂钩脚本。为了 例如,预提交模板在 PATH_TO_REPOS/hooks/pre-commit.tmpl。这些模板包含 关于钩子脚本的作用以及它可以使用哪些参数的说明 期待。

su - svn                      # As user svn
cd PATH_TO_REPOS/hooks        # Change to the hooks directory
cp pre-commit.tmpl pre-commit # Create a pre-commit script
emacs pre-commit              # Edit to taste
chmod u+x pre-commit          # It needs to be executable

来源:http://wordaligned.org/articles/a-subversion-pre-commit-hook

在您的预提交挂钩中,只需调用所需的 grunt 任务

grunt lint test

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2011-03-28
    • 2020-07-21
    • 2016-07-06
    • 2012-11-02
    • 1970-01-01
    • 2011-05-20
    • 2021-12-04
    相关资源
    最近更新 更多