提交 c3b9774f 编写于 作者: R Riyad Preukschas

Update and add checks

上级 71266ad2
此差异已折叠。
......@@ -84,7 +84,13 @@ namespace :gitlab do
# Helper methods
# Runs the given command and matches the output agains the given RegExp
# Runs the given command and matches the output agains the given pattern
#
# Returns nil if nothing matched
# Retunrs the MatchData if the pattern matched
#
# see also #run
# see also String#match
def run_and_match(command, regexp)
run(command).try(:match, regexp)
end
......@@ -93,6 +99,8 @@ namespace :gitlab do
#
# Returns nil if the command was not found
# Returns the output of the command otherwise
#
# see also #run_and_match
def run(command)
unless `#{command} 2>/dev/null`.blank?
`#{command}`
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册