Skip to content
This repository was archived by the owner on Mar 10, 2020. It is now read-only.

fix: fix formatting of mode and optional mtimes #70

Merged
merged 1 commit into from
Jan 10, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions src/cli/stat.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
const {
asBoolean
} = require('./utils')
const formatMode = require('ipfs-utils/src/files/format-mode')
const formatMtime = require('ipfs-utils/src/files/format-mtime')

module.exports = {
command: 'stat [path]',
Expand Down Expand Up @@ -81,8 +83,8 @@ Mtime: <mtime>`,
.replace('<cumulsize>', stats.cumulativeSize)
.replace('<childs>', stats.blocks)
.replace('<type>', stats.type)
.replace('<mode>', stats.mode)
.replace('<mtime>', stats.mtime)
.replace('<mode>', formatMode(stats.mode, stats.type === 'directory'))
.replace('<mtime>', formatMtime(stats.mtime))
)
})
})())
Expand Down
2 changes: 1 addition & 1 deletion test/cli/stat.js
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,6 @@ describe('stat', () => {
path,
defaultOptions()
])
expect(output).to.equal('stats-mode stats-type\n')
expect(output).to.equal('---------- stats-type\n')
})
})