@@ -126,13 +126,13 @@ export class deploy extends SourceCommand {
126126 private printComponentFailures ( result : SourceDeployResult ) : void {
127127 if ( result . status === 'Failed' && result . components ) {
128128 // sort by filename then fullname
129- const failures = result . components
130- . sort ( ( i , j ) => {
131- return i . component . type . directoryName < j . component . type . directoryName ? - 1 : 1 ;
132- } )
133- . sort ( ( i , j ) => {
134- return i . component . fullName < j . component . fullName ? - 1 : 1 ;
135- } ) ;
129+ const failures = result . components . sort ( ( i , j ) => {
130+ if ( i . component . type . directoryName === j . component . type . directoryName ) {
131+ // if the have the same directoryName then sort by fullName
132+ return i . component . fullName < j . component . fullName ? 1 : - 1 ;
133+ }
134+ return i . component . type . directoryName < j . component . type . directoryName ? 1 : - 1 ;
135+ } ) ;
136136 this . ux . log ( '' ) ;
137137 this . ux . styledHeader ( chalk . red ( `Component Failures [${ failures . length } ]` ) ) ;
138138 this . ux . table ( failures , {
@@ -157,14 +157,14 @@ export class deploy extends SourceCommand {
157157 // same metadata type, according to above comment sort on filename
158158 if ( i . component . type . directoryName === j . component . type . directoryName ) {
159159 // same filename's according to comment sort by fullName
160- return i . component . fullName < j . component . fullName ? - 1 : 1 ;
160+ return i . component . fullName < j . component . fullName ? 1 : - 1 ;
161161 }
162- return i . component . type . directoryName < j . component . type . directoryName ? - 1 : 1 ;
162+ return i . component . type . directoryName < j . component . type . directoryName ? 1 : - 1 ;
163163 }
164- return i . component . type . name < j . component . type . name ? - 1 : 1 ;
164+ return i . component . type . name < j . component . type . name ? 1 : - 1 ;
165165 } ) ;
166166 // get relative path for table output
167- files . map ( ( file ) => {
167+ files . forEach ( ( file ) => {
168168 if ( file . component . content ) {
169169 return ( file . component . content = path . relative ( process . cwd ( ) , file . component . content ) ) ;
170170 }
0 commit comments