@@ -42,6 +42,7 @@ export class ProjectTask implements ITaskDefinition {
4242 }
4343
4444 public isIncrementalBuildAllowed : boolean ;
45+ public hadEmptyScript : boolean = false ;
4546
4647 private _hasWarningOrError : boolean ;
4748 private _rushProject : RushConfigurationProject ;
@@ -64,6 +65,9 @@ export class ProjectTask implements ITaskDefinition {
6465 public execute ( writer : ITaskWriter ) : Promise < TaskStatus > {
6566 try {
6667 const taskCommand : string = this . _getScriptToRun ( ) ;
68+ if ( ! taskCommand ) {
69+ this . hadEmptyScript = true ;
70+ }
6771 const deps : IPackageDependencies | undefined = this . _getPackageDependencies ( taskCommand , writer ) ;
6872 return this . _executeTask ( taskCommand , writer , deps ) ;
6973 } catch ( error ) {
@@ -128,9 +132,15 @@ export class ProjectTask implements ITaskDefinition {
128132 FileSystem . deleteFile ( currentDepsPath ) ;
129133
130134 if ( ! taskCommand ) {
131- // tslint:disable-next-line:max-line-length
132- writer . writeLine ( `The task command ${ this . _commandToRun } was registered in the package.json but is blank, so no action will be taken.` ) ;
133- return Promise . resolve ( TaskStatus . Skipped ) ;
135+ writer . writeLine ( `The task command ${ this . _commandToRun } was registered in the package.json but is blank,`
136+ + ` so no action will be taken.` ) ;
137+
138+ // Write deps on success.
139+ if ( currentPackageDeps ) {
140+ JsonFile . save ( currentPackageDeps , currentDepsPath ) ;
141+ }
142+
143+ return Promise . resolve ( TaskStatus . Success ) ;
134144 }
135145
136146 // Run the task
@@ -166,7 +176,7 @@ export class ProjectTask implements ITaskDefinition {
166176
167177 return new Promise ( ( resolve : ( status : TaskStatus ) => void , reject : ( error : TaskError ) => void ) => {
168178 task . on ( 'close' , ( code : number ) => {
169- this . _writeLogsToDisk ( writer ) ;
179+ this . _writeLogsToDisk ( writer ) ;
170180
171181 if ( code !== 0 ) {
172182 reject ( new TaskError ( 'error' , `Returned error code: ${ code } ` ) ) ;
0 commit comments