@@ -8,7 +8,7 @@ var _ = require('lodash'),
88 path = require ( 'path' ) ,
99 temp = require ( 'temp' ) ,
1010 fs = require ( 'fs' ) ,
11- teamcity = require ( './lib/ teamcity' ) ,
11+ teamcity = require ( './teamcity' ) ,
1212
1313 PLUGIN_NAME = 'gulp-nunit-runner' ,
1414 NUNIT_CONSOLE = 'nunit-console.exe' ,
@@ -48,7 +48,7 @@ runner.getExecutable = function (options) {
4848 // trim any existing surrounding quotes and then wrap in ""
4949 executable = trim ( options . executable , '\\s' , '"' , "'" ) ;
5050 return ! path . extname ( options . executable ) ?
51- path . join ( executable , consoleRunner ) : executable ;
51+ path . join ( executable , consoleRunner ) : executable ;
5252} ;
5353
5454runner . getArguments = function ( options , assemblies ) {
@@ -114,7 +114,7 @@ function run(stream, files, options) {
114114
115115 if ( ! options . options . result && options . teamcity ) {
116116 temp . track ( ) ;
117- options . options . result = temp . path ( { suffix : '.xml' } ) ;
117+ options . options . result = temp . path ( { suffix : '.xml' } ) ;
118118 cleanupTempFiles = temp . cleanup ;
119119 }
120120
@@ -141,7 +141,11 @@ function run(stream, files, options) {
141141
142142 child . on ( 'close' , function ( code ) {
143143 if ( options . teamcity ) {
144- gutil . log . apply ( null , teamcity ( fs . readFileSync ( options . options . result , 'utf8' ) ) ) ;
144+ if ( fs . existsSync ( options . options . result ) ) {
145+ gutil . log . apply ( null , teamcity ( fs . readFileSync ( options . options . result , 'utf8' ) ) ) ;
146+ } else {
147+ fail ( stream , 'NUnit output not found: ' + options . options . result ) ;
148+ }
145149 }
146150 if ( cleanupTempFiles ) {
147151 cleanupTempFiles ( ) ;
0 commit comments