mirror of
https://github.com/balena-io/balena-cli.git
synced 2025-06-16 06:48:08 +00:00
Standardize all references to Bluebird
Change-type: patch
This commit is contained in:
@ -15,7 +15,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import * as Promise from 'bluebird';
|
||||
import * as Bluebird from 'bluebird';
|
||||
import { getVisuals } from './lazy';
|
||||
|
||||
const getBuilderPushEndpoint = function (baseUrl, owner, app) {
|
||||
@ -36,7 +36,7 @@ const bufferImage = function (docker, imageId, bufferFile) {
|
||||
const image = docker.getImage(imageId);
|
||||
const imageMetadata = image.inspect();
|
||||
|
||||
return Promise.join(
|
||||
return Bluebird.join(
|
||||
image.get(),
|
||||
imageMetadata.get('Size'),
|
||||
(imageStream, imageSize) =>
|
||||
@ -55,7 +55,7 @@ const showPushProgress = function (message) {
|
||||
};
|
||||
|
||||
const uploadToPromise = (uploadRequest, logger) =>
|
||||
new Promise(function (resolve, reject) {
|
||||
new Bluebird(function (resolve, reject) {
|
||||
const handleMessage = function (data) {
|
||||
let obj;
|
||||
data = data.toString();
|
||||
@ -88,7 +88,7 @@ const uploadToPromise = (uploadRequest, logger) =>
|
||||
});
|
||||
|
||||
/**
|
||||
* @returns {Promise<{ buildId: number }>}
|
||||
* @returns {Bluebird<{ buildId: number }>}
|
||||
*/
|
||||
const uploadImage = function (
|
||||
imageStream,
|
||||
@ -168,7 +168,7 @@ export const deployLegacy = function (
|
||||
opts,
|
||||
) {
|
||||
const tmp = require('tmp');
|
||||
const tmpNameAsync = Promise.promisify(tmp.tmpName);
|
||||
const tmpNameAsync = Bluebird.promisify(tmp.tmpName);
|
||||
|
||||
// Ensure the tmp files gets deleted
|
||||
tmp.setGracefulCleanup();
|
||||
@ -187,7 +187,7 @@ export const deployLegacy = function (
|
||||
// If the file was never written to (for instance because an error
|
||||
// has occured before any data was written) this call will throw an
|
||||
// ugly error, just suppress it
|
||||
Promise.try(() => require('mz/fs').unlink(bufferFile)).catchReturn(
|
||||
Bluebird.try(() => require('mz/fs').unlink(bufferFile)).catchReturn(
|
||||
undefined,
|
||||
),
|
||||
);
|
||||
@ -198,7 +198,7 @@ export const deployLegacy = function (
|
||||
}
|
||||
|
||||
logger.logInfo('Uploading logs...');
|
||||
return Promise.join(
|
||||
return Bluebird.join(
|
||||
logs,
|
||||
token,
|
||||
url,
|
||||
|
Reference in New Issue
Block a user