mirror of
https://github.com/balena-io/balena-cli.git
synced 2024-12-23 23:42:24 +00:00
Merge pull request #1898 from balena-io/import-lodash
Stop importing specific lodash files
This commit is contained in:
commit
a252a550ff
@ -309,7 +309,7 @@ export default class NoteCmd extends Command {
|
|||||||
// and parse the output, looking for a specific
|
// and parse the output, looking for a specific
|
||||||
// container
|
// container
|
||||||
const childProcess = await import('child_process');
|
const childProcess = await import('child_process');
|
||||||
const escapeRegex = await import('lodash/escapeRegExp');
|
const { escapeRegExp } = await import('lodash');
|
||||||
const { which } = await import('../utils/helpers');
|
const { which } = await import('../utils/helpers');
|
||||||
const { deviceContainerEngineBinary } = await import(
|
const { deviceContainerEngineBinary } = await import(
|
||||||
'../utils/device/ssh'
|
'../utils/device/ssh'
|
||||||
@ -349,7 +349,7 @@ export default class NoteCmd extends Command {
|
|||||||
});
|
});
|
||||||
|
|
||||||
const lines = containers.split('\n');
|
const lines = containers.split('\n');
|
||||||
const regex = new RegExp(`\\/?${escapeRegex(serviceName)}_\\d+_\\d+`);
|
const regex = new RegExp(`\\/?${escapeRegExp(serviceName)}_\\d+_\\d+`);
|
||||||
for (const container of lines) {
|
for (const container of lines) {
|
||||||
const [cId, name] = container.split(' ');
|
const [cId, name] = container.split(' ');
|
||||||
if (regex.test(name)) {
|
if (regex.test(name)) {
|
||||||
|
@ -29,7 +29,7 @@ export const deviceContainerEngineBinary = `$(if [ -f /usr/bin/balena ]; then ec
|
|||||||
export async function performLocalDeviceSSH(
|
export async function performLocalDeviceSSH(
|
||||||
opts: DeviceSSHOpts,
|
opts: DeviceSSHOpts,
|
||||||
): Promise<void> {
|
): Promise<void> {
|
||||||
const reduce = await import('lodash/reduce');
|
const { escapeRegExp, reduce } = await import('lodash');
|
||||||
const { spawnSshAndExitOnError } = await import('../ssh');
|
const { spawnSshAndExitOnError } = await import('../ssh');
|
||||||
const { ExpectedError } = await import('../../errors');
|
const { ExpectedError } = await import('../../errors');
|
||||||
|
|
||||||
@ -44,13 +44,12 @@ export async function performLocalDeviceSSH(
|
|||||||
// allows the user to choose the correct container
|
// allows the user to choose the correct container
|
||||||
|
|
||||||
const Docker = await import('dockerode');
|
const Docker = await import('dockerode');
|
||||||
const escapeRegex = await import('lodash/escapeRegExp');
|
|
||||||
const docker = new Docker({
|
const docker = new Docker({
|
||||||
host: opts.address,
|
host: opts.address,
|
||||||
port: 2375,
|
port: 2375,
|
||||||
});
|
});
|
||||||
|
|
||||||
const regex = new RegExp(`\\/?${escapeRegex(opts.service)}_\\d+_\\d+`);
|
const regex = new RegExp(`\\/?${escapeRegExp(opts.service)}_\\d+_\\d+`);
|
||||||
const nameRegex = /\/?([a-zA-Z0-9_]+)_\d+_\d+/;
|
const nameRegex = /\/?([a-zA-Z0-9_]+)_\d+_\d+/;
|
||||||
let allContainers: ContainerInfo[];
|
let allContainers: ContainerInfo[];
|
||||||
try {
|
try {
|
||||||
|
Loading…
Reference in New Issue
Block a user