mirror of
https://github.com/balena-io/balena-cli.git
synced 2024-12-20 22:23:07 +00:00
Remove drive command
This commit is contained in:
parent
d24b871964
commit
a715ec9dc1
@ -1,33 +0,0 @@
|
||||
(function() {
|
||||
var _, async, drivelist, visuals;
|
||||
|
||||
_ = 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.\n\nExamples:\n\n $ resin drives',
|
||||
permission: 'user',
|
||||
action: function(params, options, done) {
|
||||
return drivelist.list(function(error, drives) {
|
||||
if (error != null) {
|
||||
return done(error);
|
||||
}
|
||||
return async.reject(drives, drivelist.isSystem, function(removableDrives) {
|
||||
if (_.isEmpty(removableDrives)) {
|
||||
return done(new Error('No removable devices available'));
|
||||
}
|
||||
console.log(visuals.table.horizontal(removableDrives, ['device', 'description', 'size']));
|
||||
return done();
|
||||
});
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
}).call(this);
|
@ -3,7 +3,6 @@
|
||||
app: require('./app'),
|
||||
info: require('./info'),
|
||||
auth: require('./auth'),
|
||||
drive: require('./drive'),
|
||||
device: require('./device'),
|
||||
env: require('./environment-variables'),
|
||||
keys: require('./keys'),
|
||||
|
@ -103,8 +103,6 @@
|
||||
|
||||
capitano.command(actions.device.identify);
|
||||
|
||||
capitano.command(actions.drive.list);
|
||||
|
||||
capitano.command(actions.notes.set);
|
||||
|
||||
capitano.command(actions.preferences.preferences);
|
||||
|
@ -20,12 +20,6 @@
|
||||
"lib/actions/device.coffee"
|
||||
]
|
||||
},
|
||||
{
|
||||
"title": "Drive",
|
||||
"files": [
|
||||
"lib/actions/drive.coffee"
|
||||
]
|
||||
},
|
||||
{
|
||||
"title": "Environment Variables",
|
||||
"files": [
|
||||
@ -79,12 +73,6 @@
|
||||
"files": [
|
||||
"lib/actions/preferences.coffee"
|
||||
]
|
||||
},
|
||||
{
|
||||
"title": "Update",
|
||||
"files": [
|
||||
"lib/actions/update.coffee"
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
|
@ -34,18 +34,14 @@ Now you have access to all the commands referenced below.
|
||||
- Device
|
||||
|
||||
- [devices](#devices)
|
||||
- [device <name>](#device-60-name-62-)
|
||||
- [device rm <name>](#device-rm-60-name-62-)
|
||||
- [device <uuid>](#device-60-uuid-62-)
|
||||
- [device rm <uuid>](#device-rm-60-uuid-62-)
|
||||
- [device identify <uuid>](#device-identify-60-uuid-62-)
|
||||
- [device rename <name> [newName]](#device-rename-60-name-62-newname-)
|
||||
- [device rename <uuid> [newName]](#device-rename-60-uuid-62-newname-)
|
||||
- [devices supported](#devices-supported)
|
||||
- [device await <name>](#device-await-60-name-62-)
|
||||
- [device await <uuid>](#device-await-60-uuid-62-)
|
||||
- [device init [device]](#device-init-device-)
|
||||
|
||||
- Drive
|
||||
|
||||
- [drives](#drives)
|
||||
|
||||
- Environment Variables
|
||||
|
||||
- [envs](#envs)
|
||||
@ -94,10 +90,6 @@ Now you have access to all the commands referenced below.
|
||||
|
||||
- [preferences](#preferences)
|
||||
|
||||
- Update
|
||||
|
||||
- [update](#update)
|
||||
|
||||
# Application
|
||||
|
||||
## app create <name>
|
||||
@ -285,15 +277,15 @@ Examples:
|
||||
|
||||
application name
|
||||
|
||||
## device <name>
|
||||
## device <uuid>
|
||||
|
||||
Use this command to show information about a single device.
|
||||
|
||||
Examples:
|
||||
|
||||
$ resin device MyDevice
|
||||
$ resin device 7cf02a62a3a84440b1bb5579a3d57469148943278630b17e7fc6c4f7b465c9
|
||||
|
||||
## device rm <name>
|
||||
## device rm <uuid>
|
||||
|
||||
Use this command to remove a device from resin.io.
|
||||
|
||||
@ -302,8 +294,8 @@ You can avoid this by passing the `--yes` boolean option.
|
||||
|
||||
Examples:
|
||||
|
||||
$ resin device rm MyDevice
|
||||
$ resin device rm MyDevice --yes
|
||||
$ resin device rm 7cf02a62a3a84440b1bb5579a3d57469148943278630b17e7fc6c4f7b465c9
|
||||
$ resin device rm 7cf02a62a3a84440b1bb5579a3d57469148943278630b17e7fc6c4f7b465c9 --yes
|
||||
|
||||
### Options
|
||||
|
||||
@ -321,7 +313,7 @@ Examples:
|
||||
|
||||
$ resin device identify 23c73a12e3527df55c60b9ce647640c1b7da1b32d71e6a39849ac0f00db828
|
||||
|
||||
## device rename <name> [newName]
|
||||
## device rename <uuid> [newName]
|
||||
|
||||
Use this command to rename a device.
|
||||
|
||||
@ -329,8 +321,8 @@ If you omit the name, you'll get asked for it interactively.
|
||||
|
||||
Examples:
|
||||
|
||||
$ resin device rename MyDevice MyPi
|
||||
$ resin device rename MyDevice
|
||||
$ resin device rename 7cf02a62a3a84440b1bb5579a3d57469148943278630b17e7fc6c4f7b465c9 MyPi
|
||||
$ resin device rename 7cf02a62a3a84440b1bb5579a3d57469148943278630b17e7fc6c4f7b465c9
|
||||
|
||||
## devices supported
|
||||
|
||||
@ -340,7 +332,7 @@ Examples:
|
||||
|
||||
$ resin devices supported
|
||||
|
||||
## device await <name>
|
||||
## device await <uuid>
|
||||
|
||||
Use this command to await for a device to become online.
|
||||
|
||||
@ -352,8 +344,8 @@ You can configure the poll interval with the --interval option (defaults to 3000
|
||||
|
||||
Examples:
|
||||
|
||||
$ resin device await MyDevice
|
||||
$ resin device await MyDevice --interval 1000
|
||||
$ resin device await 7cf02a62a3a84440b1bb5579a3d57469148943278630b17e7fc6c4f7b465c9
|
||||
$ resin device await 7cf02a62a3a84440b1bb5579a3d57469148943278630b17e7fc6c4f7b465c9 --interval 1000
|
||||
|
||||
### Options
|
||||
|
||||
@ -410,16 +402,6 @@ wifi ssid, if network is wifi
|
||||
|
||||
wifi key, if network is wifi
|
||||
|
||||
# Drive
|
||||
|
||||
## drives
|
||||
|
||||
Use this command to list all drives that are connected to your machine.
|
||||
|
||||
Examples:
|
||||
|
||||
$ resin drives
|
||||
|
||||
# Environment Variables
|
||||
|
||||
## envs
|
||||
@ -435,7 +417,7 @@ Example:
|
||||
|
||||
$ resin envs --application MyApp
|
||||
$ resin envs --application MyApp --verbose
|
||||
$ resin envs --device MyDevice
|
||||
$ resin envs --device 7cf02a62a3a84440b1bb5579a3d57469148943278630b17e7fc6c4f7b465c9
|
||||
|
||||
### Options
|
||||
|
||||
@ -632,9 +614,6 @@ Use this command to show logs for a specific device.
|
||||
|
||||
By default, the command prints all log messages and exit.
|
||||
|
||||
To limit the output to the n last lines, use the `--num` option along with a number.
|
||||
This is similar to doing `resin logs <uuid> | tail -n X`.
|
||||
|
||||
To continuously stream output, and see new logs in real time, use the `--tail` option.
|
||||
|
||||
Note that for now you need to provide the whole UUID for this command to work correctly.
|
||||
@ -644,15 +623,10 @@ This is due to some technical limitations that we plan to address soon.
|
||||
Examples:
|
||||
|
||||
$ resin logs 23c73a12e3527df55c60b9ce647640c1b7da1b32d71e6a39849ac0f00db828
|
||||
$ resin logs 23c73a12e3527df55c60b9ce647640c1b7da1b32d71e6a39849ac0f00db828 --num 20
|
||||
$ resin logs 23c73a12e3527df55c60b9ce647640c1b7da1b32d71e6a39849ac0f00db828 --tail
|
||||
|
||||
### Options
|
||||
|
||||
#### --num, -n <num>
|
||||
|
||||
number of lines to display
|
||||
|
||||
#### --tail, -t
|
||||
|
||||
continuously stream output
|
||||
@ -665,18 +639,18 @@ Use this command to set or update a device note.
|
||||
|
||||
If note command isn't passed, the tool attempts to read from `stdin`.
|
||||
|
||||
To view the notes, use $ resin device <name>.
|
||||
To view the notes, use $ resin device <uuid>.
|
||||
|
||||
Examples:
|
||||
|
||||
$ resin note "My useful note" --device MyDevice
|
||||
$ cat note.txt | resin note --device MyDevice
|
||||
$ resin note "My useful note" --device 7cf02a62a3a84440b1bb5579a3d57469148943278630b17e7fc6c4f7b465c9
|
||||
$ cat note.txt | resin note --device 7cf02a62a3a84440b1bb5579a3d57469148943278630b17e7fc6c4f7b465c9
|
||||
|
||||
### Options
|
||||
|
||||
#### --device, --d,dev, --d,dev <device>
|
||||
|
||||
device name
|
||||
device uuid
|
||||
|
||||
# Plugin
|
||||
|
||||
@ -739,21 +713,3 @@ Examples:
|
||||
|
||||
$ resin preferences
|
||||
|
||||
# Update
|
||||
|
||||
## update
|
||||
|
||||
Use this command to update the Resin CLI
|
||||
|
||||
This command outputs information about the update process.
|
||||
Use `--quiet` to remove that output.
|
||||
|
||||
The Resin CLI checks for updates once per day.
|
||||
|
||||
Major updates require a manual update with this update command,
|
||||
while minor updates are applied automatically.
|
||||
|
||||
Examples:
|
||||
|
||||
$ resin update
|
||||
|
||||
|
@ -1,32 +0,0 @@
|
||||
_ = 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.table.horizontal removableDrives, [
|
||||
'device'
|
||||
'description'
|
||||
'size'
|
||||
]
|
||||
|
||||
return done()
|
@ -2,7 +2,6 @@ module.exports =
|
||||
app: require('./app')
|
||||
info: require('./info')
|
||||
auth: require('./auth')
|
||||
drive: require('./drive')
|
||||
device: require('./device')
|
||||
env: require('./environment-variables')
|
||||
keys: require('./keys')
|
||||
|
@ -76,9 +76,6 @@ capitano.command(actions.device.info)
|
||||
capitano.command(actions.device.remove)
|
||||
capitano.command(actions.device.identify)
|
||||
|
||||
# ---------- Drive Module ----------
|
||||
capitano.command(actions.drive.list)
|
||||
|
||||
# ---------- Notes Module ----------
|
||||
capitano.command(actions.notes.set)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user