UNPKG

@acurast/cli

Version:

A cli to interact with the Acurast Cloud.

39 lines 1.67 kB
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } return new (P || (P = Promise))(function (resolve, reject) { function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } step((generator = generator.apply(thisArg, _arguments || [])).next()); }); }; import { SingleBar } from 'cli-progress'; import { acurastColor } from '../util.js'; export const addCommandWatch = (program) => { program .command('watch') .description('Watch the chain and get notified when a deployment update happens') .action(() => __awaiter(void 0, void 0, void 0, function* () { // create new progress bar const b1 = new SingleBar({ format: 'New Block ' + acurastColor('{bar}') + ' {value}s', // | {percentage}% | barCompleteChar: '\u2588', barIncompleteChar: '\u2591', hideCursor: true, }); b1.start(12, 0); // update values let counter = 0; setInterval(() => { counter++; b1.update(counter); b1.render(); // b1.updateETA(); if (counter >= 12) { b1.stop(); } }, 1000); // stop the bar })); }; //# sourceMappingURL=watch.js.map