mirror of
https://github.com/balena-io/balena-cli.git
synced 2024-12-18 21:27:51 +00:00
Remove rindle dependency
Change-type: patch
This commit is contained in:
parent
0da5f822e4
commit
11afbf3da2
@ -119,7 +119,6 @@ Examples:
|
|||||||
const Bluebird = require('bluebird');
|
const Bluebird = require('bluebird');
|
||||||
const unzip = require('node-unzip-2');
|
const unzip = require('node-unzip-2');
|
||||||
const fs = require('fs');
|
const fs = require('fs');
|
||||||
const rindle = require('rindle');
|
|
||||||
const manager = require('balena-image-manager');
|
const manager = require('balena-image-manager');
|
||||||
|
|
||||||
console.info(`Getting device operating system for ${params.type}`);
|
console.info(`Getting device operating system for ${params.type}`);
|
||||||
@ -141,7 +140,7 @@ versions for the given device type are pre-release).`);
|
|||||||
}
|
}
|
||||||
return manager.get(params.type, version);
|
return manager.get(params.type, version);
|
||||||
})
|
})
|
||||||
.then(function (stream) {
|
.then(async function (stream) {
|
||||||
const visuals = getVisuals();
|
const visuals = getVisuals();
|
||||||
const bar = new visuals.Progress(
|
const bar = new visuals.Progress(
|
||||||
`Downloading Device OS${displayVersion}`,
|
`Downloading Device OS${displayVersion}`,
|
||||||
@ -172,7 +171,9 @@ versions for the given device type are pre-release).`);
|
|||||||
output = fs.createWriteStream(options.output);
|
output = fs.createWriteStream(options.output);
|
||||||
}
|
}
|
||||||
|
|
||||||
return rindle.wait(stream.pipe(output)).return(options.output);
|
const streamToPromise = await import('stream-to-promise');
|
||||||
|
await streamToPromise(stream.pipe(output));
|
||||||
|
return options.output;
|
||||||
})
|
})
|
||||||
.tap(() => {
|
.tap(() => {
|
||||||
console.info('The image was downloaded successfully');
|
console.info('The image was downloaded successfully');
|
||||||
|
@ -251,7 +251,6 @@
|
|||||||
"resin-multibuild": "^4.5.1",
|
"resin-multibuild": "^4.5.1",
|
||||||
"resin-stream-logger": "^0.1.2",
|
"resin-stream-logger": "^0.1.2",
|
||||||
"rimraf": "^3.0.2",
|
"rimraf": "^3.0.2",
|
||||||
"rindle": "^1.3.6",
|
|
||||||
"semver": "^7.1.3",
|
"semver": "^7.1.3",
|
||||||
"shell-escape": "^0.2.0",
|
"shell-escape": "^0.2.0",
|
||||||
"split": "^1.0.1",
|
"split": "^1.0.1",
|
||||||
|
32
typings/rindle/index.d.ts
vendored
32
typings/rindle/index.d.ts
vendored
@ -1,32 +0,0 @@
|
|||||||
/**
|
|
||||||
* @license
|
|
||||||
* Copyright 2019 Balena Ltd.
|
|
||||||
*
|
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
* you may not use this file except in compliance with the License.
|
|
||||||
* You may obtain a copy of the License at
|
|
||||||
*
|
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*
|
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
* See the License for the specific language governing permissions and
|
|
||||||
* limitations under the License.
|
|
||||||
*/
|
|
||||||
|
|
||||||
import * as Bluebird from 'bluebird';
|
|
||||||
|
|
||||||
declare module 'rindle' {
|
|
||||||
export function extract(
|
|
||||||
stream: NodeJS.ReadableStream,
|
|
||||||
callback: (error: Error, data: string) => void,
|
|
||||||
): void;
|
|
||||||
|
|
||||||
export function wait<T = any[]>(
|
|
||||||
stream: {
|
|
||||||
on(event: string, callback: (...args: T) => void): void;
|
|
||||||
},
|
|
||||||
callback?: (error: Error, data: string) => void,
|
|
||||||
): Bluebird<T>;
|
|
||||||
}
|
|
Loading…
Reference in New Issue
Block a user