@@ -55,7 +55,7 @@ function Sync(args) {
5555 // initalise the Synchronize command
5656 this . initialise ( args , function ( err ) {
5757 if ( err ) {
58- log ( 'Content sync failed with errors' ) ;
58+ log ( error ( 'Content sync failed with errors' ) ) ;
5959 log ( error ( err . message || JSON . stringify ( err ) ) ) ;
6060 process . exit ( 1 ) ;
6161 }
@@ -66,7 +66,6 @@ function Sync(args) {
6666 if ( self . q . length > 0 ) {
6767 var entryData = self . q . shift ( ) ;
6868 self . sync . start ( entryData ) ;
69- log ( info ( `\nRequest details\n${ JSON . stringify ( entryData . message . body ) } ` ) ) ;
7069 } else {
7170 inProgress = false ;
7271 log ( success ( 'Cotentnstack \'SYNC\' completed successfully!!' ) ) ;
@@ -236,7 +235,7 @@ Sync.prototype.loadEntries = function(contentTypes, finalCallback) {
236235 } ;
237236 }
238237 return async . eachLimit ( contentTypes , 1 , function ( contentType , cb ) {
239- return utility . getEntries ( contentType , self . inputs . language , query , [ 'title' , 'publish_details' , '_version' ] , self . inputs . environment . name , function ( error , entries ) {
238+ return utility . getEntries ( contentType , self . inputs . language , query , [ 'title' , 'publish_details' , '_version' , 'locale' ] , self . inputs . environment . name , function ( error , entries ) {
240239 if ( error ) {
241240 return cb ( error ) ;
242241 } else if ( entries . length === 0 ) {
@@ -305,7 +304,7 @@ Sync.prototype.parseEntries = function(entries, contentType, fn) {
305304 entry : {
306305 title : entry . title || entry . uid ,
307306 // TODO: clarify/confirm
308- locale : entry . locale || 'en-us' ,
307+ locale : entry . locale || self . inputs . language || 'en-us' ,
309308 version : entry . version || entry . _version ,
310309 entry_uid : entry . uid
311310 } ,
@@ -323,10 +322,9 @@ Sync.prototype.parseEntries = function(entries, contentType, fn) {
323322
324323 if ( ! inProgress ) {
325324 var entryData = self . q . shift ( ) ;
326- log ( success ( `Started content sync for ${ contentType } entries` ) ) ;
325+ debug ( `Started content sync for ${ contentType } entries` ) ;
327326 self . sync . start ( entryData ) ;
328327 inProgress = true ;
329- log ( info ( `\nRequest details:\n${ JSON . stringify ( entryData . message . body ) } ` ) ) ;
330328 }
331329 return fn ( null , null ) ;
332330 } catch ( e ) {
@@ -408,10 +406,9 @@ Sync.prototype.parseAssets = function(assets, finalCallback) {
408406
409407 if ( ! inProgress && self . q . length ) {
410408 var assetData = self . q . shift ( ) ;
411- log ( info ( 'Started content sync for assets' ) ) ;
409+ debug ( 'Started content sync for assets' ) ;
412410 self . sync . start ( assetData ) ;
413411 inProgress = true ;
414- log ( info ( `\nRequest details:\n${ JSON . stringify ( assetData . message . body ) } ` ) ) ;
415412 }
416413 return finalCallback ( null , null ) ;
417414} ;
@@ -427,7 +424,7 @@ Sync.prototype.assets = function(callback) {
427424 if ( error ) {
428425 return callback ( error ) ;
429426 } else if ( assets . length === 0 ) {
430- log ( warning ( 'No assets were found in the specified environment/stack' ) ) ;
427+ debug ( 'No assets were found in the specified environment/stack' ) ;
431428 return callback ( null , null ) ;
432429 }
433430 log ( info ( `${ assets . length } assets were retrieved` ) ) ;
0 commit comments