From 4f7aaca9d67d49a6196ea29fd52bf97e6f237723 Mon Sep 17 00:00:00 2001 From: Juan Ferrer Toribio Date: Thu, 30 Jan 2020 16:19:09 +0100 Subject: [PATCH] Added setEnv function --- vars/util.groovy | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/vars/util.groovy b/vars/util.groovy index 50eb14a..2a8a248 100644 --- a/vars/util.groovy +++ b/vars/util.groovy @@ -1,8 +1,6 @@ #!/usr/bin/env groovy -sh 'printenv' - -def sendEmail() { +def setEnv() { if (!env.GIT_COMMITTER_EMAIL) { env.COMMITTER_EMAIL = sh( script: 'git --no-pager show -s --format="%ae"', @@ -12,6 +10,10 @@ def sendEmail() { env.COMMITTER_EMAIL = env.GIT_COMMITTER_EMAIL; } + sh 'printenv' +} + +def sendEmail() { if (!env.COMMITTER_EMAIL) return try { mail(