File tree 2 files changed +5
-3
lines changed
2 files changed +5
-3
lines changed Original file line number Diff line number Diff line change 3
3
const {
4
4
asBoolean
5
5
} = require ( './utils' )
6
+ const formatMode = require ( 'ipfs-utils/src/files/format-mode' )
7
+ const formatMtime = require ( 'ipfs-utils/src/files/format-mtime' )
6
8
7
9
module . exports = {
8
10
command : 'stat [path]' ,
@@ -81,8 +83,8 @@ Mtime: <mtime>`,
81
83
. replace ( '<cumulsize>' , stats . cumulativeSize )
82
84
. replace ( '<childs>' , stats . blocks )
83
85
. replace ( '<type>' , stats . type )
84
- . replace ( '<mode>' , stats . mode )
85
- . replace ( '<mtime>' , stats . mtime )
86
+ . replace ( '<mode>' , formatMode ( stats . mode , stats . type === 'directory' ) )
87
+ . replace ( '<mtime>' , formatMtime ( stats . mtime ) )
86
88
)
87
89
} )
88
90
} ) ( ) )
Original file line number Diff line number Diff line change @@ -137,6 +137,6 @@ describe('stat', () => {
137
137
path ,
138
138
defaultOptions ( )
139
139
] )
140
- expect ( output ) . to . equal ( 'stats-mode stats-type\n' )
140
+ expect ( output ) . to . equal ( '---------- stats-type\n' )
141
141
} )
142
142
} )
You can’t perform that action at this time.
0 commit comments