@@ -97,15 +97,14 @@ protected override void AutobuildFailureDiagnostic()
97
97
// run and found at least one script to execute
98
98
if ( this . autoBuildRule . BuildCommandAutoRule . ScriptPath is not null )
99
99
{
100
- DiagnosticMessage message ;
101
100
var relScriptPath = this . MakeRelative ( autoBuildRule . BuildCommandAutoRule . ScriptPath ) ;
102
101
103
102
// if we found multiple build scripts in the project directory, then we can say
104
103
// as much to indicate that we may have picked the wrong one;
105
104
// otherwise, we just report that the one script we found didn't work
106
- if ( this . autoBuildRule . BuildCommandAutoRule . CandidatePaths . Count ( ) > 1 )
107
- {
108
- message = new (
105
+ DiagnosticMessage message =
106
+ this . autoBuildRule . BuildCommandAutoRule . CandidatePaths . Count ( ) > 1 ?
107
+ new (
109
108
this . Options . Language ,
110
109
"multiple-build-scripts" ,
111
110
"There are multiple potential build scripts" ,
@@ -114,11 +113,8 @@ protected override void AutobuildFailureDiagnostic()
114
113
$ "attempted to run `{ relScriptPath } `, which failed. " +
115
114
"This may not be the right build script for your project. " +
116
115
$ "Set up a [manual build command]({ buildCommandDocsUrl } )."
117
- ) ;
118
- }
119
- else
120
- {
121
- message = new (
116
+ ) :
117
+ new (
122
118
this . Options . Language ,
123
119
"script-failure" ,
124
120
"Unable to build project using build script" ,
@@ -127,7 +123,6 @@ protected override void AutobuildFailureDiagnostic()
127
123
$ "`{ relScriptPath } `, which failed. " +
128
124
$ "Set up a [manual build command]({ buildCommandDocsUrl } )."
129
125
) ;
130
- }
131
126
132
127
AddDiagnostic ( message ) ;
133
128
}
0 commit comments