(_options: SWACLIConfig)
| 99 | } |
| 100 | |
| 101 | export async function swaMagic(_options: SWACLIConfig) { |
| 102 | try { |
| 103 | const hasLoadedConfig = getCurrentSwaCliConfigFromFile(); |
| 104 | if (!hasLoadedConfig) { |
| 105 | logger.log(`${chalk.cyan("→")} No configuration found, running ${chalk.cyan("swa init")}...\n`); |
| 106 | runCommand("swa init"); |
| 107 | } |
| 108 | |
| 109 | logger.log(`${chalk.cyan("→")} Running ${chalk.cyan("swa build")}...\n`); |
| 110 | runCommand("swa build"); |
| 111 | logger.log(""); |
| 112 | |
| 113 | const response = await promptOrUseDefault(false, { |
| 114 | type: "confirm", |
| 115 | name: "deploy", |
| 116 | message: "Do you want to deploy your app now?", |
| 117 | initial: true, |
| 118 | }); |
| 119 | if (!response.deploy) { |
| 120 | logger.log(`\nWhen you'll be ready to deploy your app, just use ${chalk.cyan("swa")} again.`); |
| 121 | return; |
| 122 | } |
| 123 | |
| 124 | logger.log(`\n${chalk.cyan("→")} Running ${chalk.cyan("swa deploy")}...\n`); |
| 125 | runCommand("swa deploy"); |
| 126 | } catch (_) { |
| 127 | // Pokemon, go catch'em all! |
| 128 | // (Errors are already caught an displayed in individual commands) |
| 129 | } |
| 130 | } |
no test coverage detected
searching dependent graphs…