From 25842a3e72c01fd4d897e960875b2ae9a2213267 Mon Sep 17 00:00:00 2001 From: Oleg Sucharevich Date: Tue, 19 May 2020 15:20:55 +0300 Subject: [PATCH] Saas 6975 1 (#463) * create mock progress reporter when token does not support runner-install scope --- .../cli/commands/hybrid/installation-process.js | 13 +++++++++++-- package.json | 2 +- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/lib/interface/cli/commands/hybrid/installation-process.js b/lib/interface/cli/commands/hybrid/installation-process.js index 6d5645ecb..d5d966f96 100644 --- a/lib/interface/cli/commands/hybrid/installation-process.js +++ b/lib/interface/cli/commands/hybrid/installation-process.js @@ -1,11 +1,20 @@ +const Promise = require('bluebird'); +const { to } = require('./../../../../logic/cli-config/errors/awaitTo'); + async function create(installer, event) { - const res = await installer.createNewInstallationProgress(event); + const [err, res] = await to(installer.createNewInstallationProgress(event)); + if (err) { + return {}; + } return res.progress; } function buildReporter(installer, progress) { return { - report: (event, status, options = {}) => { + report: async (event, status, options = {}) => { + if (!progress.id) { + return Promise.resolve(); + } const data = { event, content: { diff --git a/package.json b/package.json index 0587305f8..2fff1177c 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "codefresh", - "version": "0.63.2", + "version": "0.63.3", "description": "Codefresh command line utility", "main": "index.js", "preferGlobal": true,