mirror of
https://github.com/balena-io/balena-cli.git
synced 2025-02-22 10:11:01 +00:00
Replace occurrence of through2 dependency with standard stream module
Change-type: patch
This commit is contained in:
parent
948095ce4d
commit
3bf8befb1d
@ -88,15 +88,17 @@ async function execCommand(
|
|||||||
cmd: string,
|
cmd: string,
|
||||||
msg: string,
|
msg: string,
|
||||||
): Promise<void> {
|
): Promise<void> {
|
||||||
const through = await import('through2');
|
const { Writable } = await import('stream');
|
||||||
const visuals = getVisuals();
|
const visuals = getVisuals();
|
||||||
|
|
||||||
const spinner = new visuals.Spinner(`[${deviceIp}] Connecting...`);
|
const spinner = new visuals.Spinner(`[${deviceIp}] Connecting...`);
|
||||||
const innerSpinner = spinner.spinner;
|
const innerSpinner = spinner.spinner;
|
||||||
|
|
||||||
const stream = through(function (data, _enc, cb) {
|
const stream = new Writable({
|
||||||
|
write(_chunk: Buffer, _enc, callback) {
|
||||||
innerSpinner.setSpinnerTitle(`%s [${deviceIp}] ${msg}`);
|
innerSpinner.setSpinnerTitle(`%s [${deviceIp}] ${msg}`);
|
||||||
cb(null, data);
|
callback();
|
||||||
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
spinner.start();
|
spinner.start();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user