mirror of
https://github.com/balena-io/balena-cli.git
synced 2025-02-20 01:16:43 +00:00
Switch to native Array.isArray
instead of aliases
Change-type: patch
This commit is contained in:
parent
18d3ca3413
commit
f859d5025a
@ -36,7 +36,7 @@ export function getOptionSignature(signature: string) {
|
||||
export function parseCapitanoOption(option: OptionDefinition): string {
|
||||
let result = getOptionSignature(option.signature);
|
||||
|
||||
if (_.isArray(option.alias)) {
|
||||
if (Array.isArray(option.alias)) {
|
||||
for (const alias of option.alias) {
|
||||
result += `, ${getOptionSignature(alias)}`;
|
||||
}
|
||||
|
@ -86,7 +86,6 @@ export const logs: CommandDefinition<
|
||||
async action(params, options, done) {
|
||||
normalizeUuidProp(params);
|
||||
const balena = getBalenaSdk();
|
||||
const isArray = await import('lodash/isArray');
|
||||
const { serviceIdToName } = await import('../utils/cloud');
|
||||
const { displayDeviceLogs, displayLogObject } = await import(
|
||||
'../utils/device/logs'
|
||||
@ -101,7 +100,7 @@ export const logs: CommandDefinition<
|
||||
|
||||
const servicesToDisplay =
|
||||
options.service != null
|
||||
? isArray(options.service)
|
||||
? Array.isArray(options.service)
|
||||
? options.service
|
||||
: [options.service]
|
||||
: undefined;
|
||||
|
@ -249,7 +249,7 @@ module.exports =
|
||||
options.pinDevice = options['pin-device-to-release'] || false
|
||||
delete options['pin-device-to-release']
|
||||
|
||||
if _.isArray(options['add-certificate'])
|
||||
if Array.isArray(options['add-certificate'])
|
||||
certificates = options['add-certificate']
|
||||
else if options['add-certificate'] == undefined
|
||||
certificates = []
|
||||
|
@ -263,7 +263,6 @@ export const push: CommandDefinition<
|
||||
async action(params, options) {
|
||||
const sdk = getBalenaSdk();
|
||||
const Bluebird = await import('bluebird');
|
||||
const isArray = await import('lodash/isArray');
|
||||
const remote = await import('../utils/remote-build');
|
||||
const deviceDeploy = await import('../utils/device/deploy');
|
||||
const { checkLoggedIn } = await import('../utils/patterns');
|
||||
@ -348,7 +347,7 @@ export const push: CommandDefinition<
|
||||
const device = appOrDevice;
|
||||
const servicesToDisplay =
|
||||
options.service != null
|
||||
? isArray(options.service)
|
||||
? Array.isArray(options.service)
|
||||
? options.service
|
||||
: [options.service]
|
||||
: undefined;
|
||||
|
@ -18,7 +18,6 @@ import { CommandDefinition } from 'capitano';
|
||||
import { stripIndent } from 'common-tags';
|
||||
import * as _ from 'lodash';
|
||||
import { createServer, Server, Socket } from 'net';
|
||||
import { isArray } from 'util';
|
||||
|
||||
import { getBalenaSdk } from '../utils/lazy';
|
||||
import { getOnlineTargetUuid } from '../utils/patterns';
|
||||
@ -121,7 +120,7 @@ export const tunnel: CommandDefinition<Args, Options> = {
|
||||
}
|
||||
|
||||
const ports =
|
||||
typeof options.port !== 'string' && isArray(options.port)
|
||||
typeof options.port !== 'string' && Array.isArray(options.port)
|
||||
? (options.port as string[])
|
||||
: [options.port as string];
|
||||
|
||||
|
@ -376,9 +376,7 @@ getPreviousRepos = (sdk, docker, logger, appID) ->
|
||||
logger.logDebug("Failed to access previously pushed image repo: #{e}")
|
||||
|
||||
authorizePush = (sdk, logger, tokenAuthEndpoint, registry, images, previousRepos) ->
|
||||
_ = require('lodash')
|
||||
|
||||
if not _.isArray(images)
|
||||
if not Array.isArray(images)
|
||||
images = [ images ]
|
||||
|
||||
images.push previousRepos...
|
||||
|
@ -148,8 +148,7 @@ generateConnectOpts = (opts) ->
|
||||
return connectOpts
|
||||
|
||||
parseBuildArgs = (args) ->
|
||||
_ = require('lodash')
|
||||
if not _.isArray(args)
|
||||
if not Array.isArray(args)
|
||||
args = [ args ]
|
||||
buildArgs = {}
|
||||
args.forEach (arg) ->
|
||||
|
Loading…
x
Reference in New Issue
Block a user