mirror of
https://github.com/balena-io/balena-cli.git
synced 2024-12-20 06:07:55 +00:00
33 lines
742 B
CoffeeScript
33 lines
742 B
CoffeeScript
_ = require('lodash')
|
|
async = require('async')
|
|
visuals = require('resin-cli-visuals')
|
|
drivelist = require('drivelist')
|
|
|
|
exports.list =
|
|
signature: 'drives'
|
|
description: 'list available drives'
|
|
help: '''
|
|
Use this command to list all drives that are connected to your machine.
|
|
|
|
Examples:
|
|
|
|
$ resin drives
|
|
'''
|
|
permission: 'user'
|
|
action: (params, options, done) ->
|
|
drivelist.list (error, drives) ->
|
|
return done(error) if error?
|
|
|
|
async.reject drives, drivelist.isSystem, (removableDrives) ->
|
|
|
|
if _.isEmpty(removableDrives)
|
|
return done(new Error('No removable devices available'))
|
|
|
|
console.log visuals.widgets.table.horizontal removableDrives, [
|
|
'device'
|
|
'description'
|
|
'size'
|
|
]
|
|
|
|
return done()
|