mirror of
https://github.com/balena-io/balena-cli.git
synced 2025-06-22 01:39:03 +00:00
Don't require a login for commands operating on local devices
Change-type: patch Closes: #1195 Signed-off-by: Cameron Diver <cameron@balena.io>
This commit is contained in:
committed by
Paulo Castro
parent
1a1861bfcb
commit
0ee73f5164
@ -1305,8 +1305,9 @@ id of the application to preload
|
|||||||
|
|
||||||
#### --commit, -c <hash>
|
#### --commit, -c <hash>
|
||||||
|
|
||||||
the commit hash for a specific application release to preload, use "latest" to specify the latest release
|
The commit hash for a specific application release to preload, use "current" to specify the current
|
||||||
(ignored if no appId is given)
|
release (ignored if no appId is given). The current release is usually also the latest, but can be
|
||||||
|
manually pinned using https://github.com/balena-io-projects/staged-releases .
|
||||||
|
|
||||||
#### --splash-image, -s <splashImage.png>
|
#### --splash-image, -s <splashImage.png>
|
||||||
|
|
||||||
|
@ -91,7 +91,6 @@ export const logs: CommandDefinition<
|
|||||||
'Only show system logs. This can be used in combination with --service.',
|
'Only show system logs. This can be used in combination with --service.',
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
permission: 'user',
|
|
||||||
primary: true,
|
primary: true,
|
||||||
async action(params, options, done) {
|
async action(params, options, done) {
|
||||||
normalizeUuidProp(params);
|
normalizeUuidProp(params);
|
||||||
@ -101,7 +100,9 @@ export const logs: CommandDefinition<
|
|||||||
'../utils/device/logs'
|
'../utils/device/logs'
|
||||||
);
|
);
|
||||||
const { validateIPAddress } = await import('../utils/validation');
|
const { validateIPAddress } = await import('../utils/validation');
|
||||||
const { exitWithExpectedError } = await import('../utils/patterns');
|
const { exitIfNotLoggedIn, exitWithExpectedError } = await import(
|
||||||
|
'../utils/patterns'
|
||||||
|
);
|
||||||
const Logger = await import('../utils/logger');
|
const Logger = await import('../utils/logger');
|
||||||
|
|
||||||
const logger = new Logger();
|
const logger = new Logger();
|
||||||
@ -153,6 +154,7 @@ export const logs: CommandDefinition<
|
|||||||
options.service,
|
options.service,
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
|
exitIfNotLoggedIn();
|
||||||
if (options.tail) {
|
if (options.tail) {
|
||||||
return balena.logs
|
return balena.logs
|
||||||
.subscribe(params.uuidOrDevice, { count: 100 })
|
.subscribe(params.uuidOrDevice, { count: 100 })
|
||||||
|
@ -275,7 +275,6 @@ export const ssh: CommandDefinition<
|
|||||||
installed in your shell environment. For more information (including Windows
|
installed in your shell environment. For more information (including Windows
|
||||||
support) please check:
|
support) please check:
|
||||||
https://github.com/balena-io/balena-cli/blob/master/INSTALL.md#additional-dependencies`,
|
https://github.com/balena-io/balena-cli/blob/master/INSTALL.md#additional-dependencies`,
|
||||||
permission: 'user',
|
|
||||||
options: [
|
options: [
|
||||||
{
|
{
|
||||||
signature: 'port',
|
signature: 'port',
|
||||||
@ -304,6 +303,7 @@ export const ssh: CommandDefinition<
|
|||||||
const hasbin = require('hasbin');
|
const hasbin = require('hasbin');
|
||||||
const { getSubShellCommand } = await import('../utils/helpers');
|
const { getSubShellCommand } = await import('../utils/helpers');
|
||||||
const { child_process } = await import('mz');
|
const { child_process } = await import('mz');
|
||||||
|
const { exitIfNotLoggedIn } = await import('../utils/patterns');
|
||||||
|
|
||||||
const { exitWithExpectedError, selectFromList } = await import(
|
const { exitWithExpectedError, selectFromList } = await import(
|
||||||
'../utils/patterns'
|
'../utils/patterns'
|
||||||
@ -366,6 +366,7 @@ export const ssh: CommandDefinition<
|
|||||||
|
|
||||||
switch (paramChecks.target) {
|
switch (paramChecks.target) {
|
||||||
case SSHTarget.APPLICATION:
|
case SSHTarget.APPLICATION:
|
||||||
|
exitIfNotLoggedIn();
|
||||||
// Here what we want to do is fetch all device which
|
// Here what we want to do is fetch all device which
|
||||||
// are part of this application, and online
|
// are part of this application, and online
|
||||||
try {
|
try {
|
||||||
@ -395,6 +396,7 @@ export const ssh: CommandDefinition<
|
|||||||
throw e;
|
throw e;
|
||||||
}
|
}
|
||||||
case SSHTarget.DEVICE:
|
case SSHTarget.DEVICE:
|
||||||
|
exitIfNotLoggedIn();
|
||||||
// We want to do two things here; firstly, check
|
// We want to do two things here; firstly, check
|
||||||
// that the device exists and is accessible, and
|
// that the device exists and is accessible, and
|
||||||
// also convert a short uuid to a long one if
|
// also convert a short uuid to a long one if
|
||||||
|
Reference in New Issue
Block a user