File tree Expand file tree Collapse file tree 1 file changed +10
-9
lines changed
src/PostSharp.Engineering.BuildTools/Resources Expand file tree Collapse file tree 1 file changed +10
-9
lines changed Original file line number Diff line number Diff line change @@ -145,20 +145,21 @@ if (-not $KeepEnv)
145145 }
146146
147147 # Add git identity to environment
148- $env: GIT_USER_EMAIL = git config -- global user.email
149- $env: GIT_USER_NAME = git config -- global user.name
150-
151148 if ($env: IS_TEAMCITY_AGENT )
152149 {
153- if (-not $env: GIT_USER_EMAIL )
154- {
155- $env: GIT_USER_EMAIL = ' [email protected] ' 156- }
157- if (-not $env: GIT_USER_NAME )
150+ # On TeamCity agents, check if the environment variables are set.
151+ if (-not $env: GIT_USER_EMAIL -or -not $env: GIT_USER_NAME )
158152 {
159- $env: GIT_USER_NAME = ' teamcity'
153+ Write-Error " On TeamCity agents, the GIT_USER_EMAIL and GIT_USER_NAME environment variables must be set."
154+ exit 1
160155 }
161156 }
157+ else
158+ {
159+ # On developer machines, use the current git user.
160+ $env: GIT_USER_EMAIL = git config -- global user.email
161+ $env: GIT_USER_NAME = git config -- global user.name
162+ }
162163
163164 New-EnvJson - EnvironmentVariableList $EnvironmentVariables
164165}
You can’t perform that action at this time.
0 commit comments