@@ -175,8 +175,8 @@ export class Repo {
175
175
*/
176
176
async showRepo ( repoUrl : string | string [ ] , flags : RepoFlags ) : Promise < void > {
177
177
// Get the repositories
178
- const systemConfig = await this . objects . getObjectAsync ( 'system.config' ) ;
179
- const systemRepos = await this . objects . getObjectAsync ( 'system.repositories' ) ;
178
+ const systemConfig = await this . objects . getObject ( 'system.config' ) ;
179
+ const systemRepos = await this . objects . getObject ( 'system.repositories' ) ;
180
180
if ( ! systemConfig ) {
181
181
console . error ( 'Error: Object "system.config" not found' ) ;
182
182
} else if ( ! systemRepos ) {
@@ -331,22 +331,30 @@ export class Repo {
331
331
*/
332
332
async showRepoStatus ( ) : Promise < number > {
333
333
try {
334
- const obj = await this . objects . getObjectAsync ( 'system.repositories' ) ;
334
+ const obj = await this . objects . getObject ( 'system.repositories' ) ;
335
+ const objCfg = await this . objects . getObject ( 'system.config' ) ;
336
+
335
337
if ( ! obj ) {
336
338
console . error ( 'List is empty' ) ;
337
339
return EXIT_CODES . CANNOT_GET_REPO_LIST ;
338
340
} else if ( obj . native . repositories ) {
339
- Object . keys ( obj . native . repositories ) . forEach ( r =>
340
- console . log ( `${ r . padEnd ( 14 ) } : ${ obj . native . repositories [ r ] . link } ` )
341
+ console . table (
342
+ Object . entries ( obj . native . repositories ) . map ( ( [ key , value ] ) => {
343
+ return {
344
+ name : key ,
345
+ url : value . link ,
346
+ 'auto upgrade' : objCfg ?. common . adapterAutoUpgrade ?. repositories [ key ] ?? false
347
+ } ;
348
+ } )
341
349
) ;
342
350
343
- const objCfg = await this . objects . getObjectAsync ( 'system.config' ) ;
344
351
if ( objCfg ?. common ) {
345
352
let activeRepo = objCfg . common . activeRepo ;
346
353
if ( typeof activeRepo === 'string' ) {
347
354
activeRepo = [ activeRepo ] ;
348
355
}
349
356
console . log ( `\nActive repo(s): ${ activeRepo . join ( ', ' ) } ` ) ;
357
+ console . log ( `Upgrade policy: ${ objCfg . common . adapterAutoUpgrade ?. defaultPolicy ?? 'none' } ` ) ;
350
358
}
351
359
} else {
352
360
console . error ( 'List is empty' ) ;
0 commit comments