badgr-cli 1.1.4 → 1.1.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/src/progress.js CHANGED
@@ -33,11 +33,14 @@ export function clearBlock(lineCount) {
33
33
  // `badgr serve` (deployment) and `badgr run` (job): elapsed time, a status
34
34
  // word, an *estimated* spend (never presented as confirmed while billing is
35
35
  // still live), and the exact commands to inspect logs or stop billing.
36
- export function renderLiveBlock(chalk, { stageLine, elapsedSec, statusWord, spend, id }) {
36
+ export function renderLiveBlock(chalk, { stageLine, elapsedSec, statusWord, spend, id, maxCost }) {
37
+ const spendLine = maxCost
38
+ ? ` Estimated spend: ~$${spend.toFixed(2)} / $${maxCost.toFixed(2)}`
39
+ : ` Estimated spend: ~$${spend.toFixed(2)}`;
37
40
  return [
38
41
  chalk.dim(`${stageLine} ${elapsedSec}s elapsed`),
39
42
  chalk.dim(` Status: ${statusWord}`),
40
- chalk.dim(` Estimated spend: ~$${spend.toFixed(2)}`),
43
+ chalk.dim(spendLine),
41
44
  chalk.dim(` Logs: badgr logs ${id}`),
42
45
  chalk.dim(` Stop billing: badgr down ${id}`),
43
46
  ];