mirror of
https://github.com/balena-io/balena-cli.git
synced 2024-12-19 05:37:51 +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
|
||||
// container
|
||||
const childProcess = await import('child_process');
|
||||
const escapeRegex = await import('lodash/escapeRegExp');
|
||||
const { escapeRegExp } = await import('lodash');
|
||||
const { which } = await import('../utils/helpers');
|
||||
const { deviceContainerEngineBinary } = await import(
|
||||
'../utils/device/ssh'
|
||||
@ -349,7 +349,7 @@ export default class NoteCmd extends Command {
|
||||
});
|
||||
|
||||
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) {
|
||||
const [cId, name] = container.split(' ');
|
||||
if (regex.test(name)) {
|
||||
|
@ -29,7 +29,7 @@ export const deviceContainerEngineBinary = `$(if [ -f /usr/bin/balena ]; then ec
|
||||
export async function performLocalDeviceSSH(
|
||||
opts: DeviceSSHOpts,
|
||||
): Promise<void> {
|
||||
const reduce = await import('lodash/reduce');
|
||||
const { escapeRegExp, reduce } = await import('lodash');
|
||||
const { spawnSshAndExitOnError } = await import('../ssh');
|
||||
const { ExpectedError } = await import('../../errors');
|
||||
|
||||
@ -44,13 +44,12 @@ export async function performLocalDeviceSSH(
|
||||
// allows the user to choose the correct container
|
||||
|
||||
const Docker = await import('dockerode');
|
||||
const escapeRegex = await import('lodash/escapeRegExp');
|
||||
const docker = new Docker({
|
||||
host: opts.address,
|
||||
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+/;
|
||||
let allContainers: ContainerInfo[];
|
||||
try {
|
||||
|
Loading…
Reference in New Issue
Block a user