Skip to content

Commit

Permalink
report progress
Browse files Browse the repository at this point in the history
  • Loading branch information
CNCF-Bot committed Jul 12, 2023
1 parent 0b41bc5 commit 3775e22
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions netlify/landscape.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,14 @@ const debug = function() {
}
}

const runLocal = function(command) {
const runLocal = function(command, showProgress) {

// report the output once every 5 seconds
let lastOutput = { s: '', time: new Date().getTime() };
let displayIfRequired = function(text) {
if (showProgress) {
console.info(text);
}
lastOutput.s = lastOutput.s + text;
}

Expand Down Expand Up @@ -89,7 +92,7 @@ const runRemote = async function(command, count = 3) {
${command}
EOSSH
`
const result = await runLocal(bashCommand);
const result = await runLocal(bashCommand, true);
if (result.exitCode === 255 && count > 0) {
console.info(`Attempts to retry more: ${count}`);
return await runRemote(command, count - 1);
Expand Down

0 comments on commit 3775e22

Please sign in to comment.