* Run the Pro Installation Wizard. * * @param {string} [key] - Pre-provided license key
(key)
| 82 | * @param {string} [key] - Pre-provided license key |
| 83 | */ |
| 84 | function runProWizard(key) { |
| 85 | // Lazy import to avoid requiring installer when not needed |
| 86 | let proSetup; |
| 87 | try { |
| 88 | try { |
| 89 | proSetup = require('@aiox-squads/installer/pro-setup'); |
| 90 | } catch { |
| 91 | proSetup = require('../../installer/src/wizard/pro-setup'); |
| 92 | } |
| 93 | } catch { |
| 94 | console.error('Pro wizard module not found.'); |
| 95 | console.error('Ensure aiox-core installer is available.\n'); |
| 96 | process.exit(1); |
| 97 | } |
| 98 | |
| 99 | const options = {}; |
| 100 | if (key) { |
| 101 | options.key = key; |
| 102 | } |
| 103 | |
| 104 | proSetup |
| 105 | .runProWizard(options) |
| 106 | .then((result) => { |
| 107 | if (!result.success) { |
| 108 | process.exit(1); |
| 109 | } |
| 110 | }) |
| 111 | .catch((err) => { |
| 112 | console.error(`\n Wizard failed: ${err.message}\n`); |
| 113 | process.exit(1); |
| 114 | }); |
| 115 | } |
| 116 | |
| 117 | // ─── Commands ─────────────────────────────────────────────────────────────── |
| 118 |
no test coverage detected