File tree Expand file tree Collapse file tree 3 files changed +12
-12
lines changed Expand file tree Collapse file tree 3 files changed +12
-12
lines changed Original file line number Diff line number Diff line change 1+ import chalk from 'chalk'
12import { LeafCommand } from 'furious-commander'
23import { PinningCommand } from './pinning-command'
34
@@ -6,21 +7,20 @@ export class List extends PinningCommand implements LeafCommand {
67
78 public readonly alias = 'ls'
89
9- public readonly description = 'List pinned chunks '
10+ public readonly description = 'List pinned root hashes '
1011
1112 public async run ( ) : Promise < void > {
1213 await super . init ( )
14+ this . console . info ( 'Getting pinned root hashes...' )
1315
14- this . console . info ( 'Getting pinned chunks...' )
16+ const pins = await this . bee . getAllPins ( )
1517
16- const chunks = await this . bee . getAllPins ( )
18+ this . console . log ( chalk . bold ( `Found ${ pins . length } pinned root hashes` ) )
19+ this . console . log ( '' )
1720
18- this . console . log ( `Found ${ chunks . length } pinned chunks` )
19- this . console . divider ( )
20-
21- for ( const chunk of chunks ) {
22- this . console . log ( ` - ${ chunk } ` )
23- this . console . quiet ( chunk )
21+ for ( const pin of pins ) {
22+ this . console . log ( pin )
23+ this . console . quiet ( pin )
2424 }
2525 }
2626}
Original file line number Diff line number Diff line change @@ -14,7 +14,7 @@ export class ReuploadAll extends PinningCommand implements LeafCommand {
1414 const total = chunks . length
1515 let successful = 0
1616
17- this . console . log ( ' Found ' + total + ' chunks to reupload...' )
17+ this . console . log ( ` Found ${ total } root chunks to reupload...` )
1818
1919 for ( const chunk of chunks ) {
2020 try {
@@ -26,7 +26,7 @@ export class ReuploadAll extends PinningCommand implements LeafCommand {
2626 }
2727 }
2828
29- this . console . log ( ' Reuploaded ' + successful + ' out of ' + total + ' pinned chunks' )
29+ this . console . log ( ` Reuploaded ${ successful } out of ${ total } pinned root chunks` )
3030 this . console . quiet ( successful + '/' + total )
3131 }
3232
Original file line number Diff line number Diff line change @@ -95,7 +95,7 @@ describeCommand(
9595
9696 it ( 'should reupload all pinned content' , async ( ) => {
9797 await invokeTestCli ( [ 'pinning' , 'reupload-all' ] )
98- expect ( getLastMessage ( ) ) . toMatch ( / R e u p l o a d e d \d + o u t o f \d + p i n n e d c h u n k s / )
98+ expect ( getLastMessage ( ) ) . toMatch ( / R e u p l o a d e d \d + o u t o f \d + p i n n e d r o o t c h u n k s / )
9999 } )
100100 } ,
101101 { configFileName : 'pinning' } ,
You can’t perform that action at this time.
0 commit comments