UNPKG

@graphprotocol/graph-cli

Version:

CLI for building for and deploying to The Graph

26 lines (25 loc) 614 B
import { prompt } from 'gluegun'; export async function retryWithPrompt(func) { for (;;) { try { return await func(); } catch (_) { try { const { retry } = await prompt.ask({ type: 'confirm', name: 'retry', message: 'Do you want to retry?', initial: true, }); if (!retry) { break; } } catch (_) { break; } } } return undefined; }