J'essaie d'obtenir des informations sur un commit spécifique. Comment ajouter un tuyau à la ligne de commande?Comment ajouter un tuyau à la ligne de commande exec groovy?
def getCommitLog(commit){
def stdout = new ByteArrayOutputStream()
exec {
ignoreExitValue true
workingDir 'my_dir'
commandLine 'git', 'log', '--decorate', '|', 'grep', commit
standardOutput = stdout
}
def retval = stdout.toString().trim()
return retval
Il jette cette erreur:
fatal: ambiguous argument '|': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions, like this:
'git <command> [<revision>...] -- [<file>...]
Pouvez-vous montrer à quoi ressemble la méthode 'exec'? –