ante-erp-cli 1.11.20 → 1.11.22

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/bin/ante-cli.js CHANGED
@@ -50,6 +50,7 @@ program
50
50
  .option('--preset <type>', 'Installation preset (minimal, standard, enterprise)', 'standard')
51
51
  .option('--no-interactive', 'Non-interactive mode with defaults')
52
52
  .option('--skip-checks', 'Skip system requirements check')
53
+ .option('--force', 'Force reinstall even if already installed (dangerous)')
53
54
  .option('--with-facial', 'Install Facial Recognition Web app')
54
55
  .option('--with-gate', 'Install Gate App')
55
56
  .option('--with-guardian', 'Install Guardian App')
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ante-erp-cli",
3
- "version": "1.11.20",
3
+ "version": "1.11.22",
4
4
  "description": "Comprehensive CLI tool for managing ANTE ERP self-hosted installations",
5
5
  "type": "module",
6
6
  "bin": {
@@ -139,8 +139,22 @@ export async function install(options) {
139
139
  // Check if already installed
140
140
  const existing = detectInstallation();
141
141
  if (existing && !options.force) {
142
- console.log(chalk.yellow('⚠ ANTE is already installed at:'), chalk.white(existing));
143
- console.log(chalk.gray('Proceeding with re-installation...\n'));
142
+ console.log(chalk.yellow('\n ANTE is already installed\n'));
143
+ console.log(chalk.gray('Installation directory: ') + chalk.white(existing));
144
+ console.log(chalk.cyan('\n📋 What you can do:\n'));
145
+ console.log(chalk.gray(' • Update existing installation: ') + chalk.white('ante update'));
146
+ console.log(chalk.gray(' • Check current status: ') + chalk.white('ante status'));
147
+ console.log(chalk.gray(' • Force reinstall (dangerous): ') + chalk.white('ante install --force'));
148
+ console.log(chalk.gray('\nTo completely remove and reinstall:'));
149
+ console.log(chalk.gray(' ') + chalk.white('ante uninstall --force && ante install\n'));
150
+ console.error(chalk.red('✗ Installation aborted to prevent data loss.\n'));
151
+ process.exit(1);
152
+ }
153
+
154
+ if (existing && options.force) {
155
+ console.log(chalk.yellow('\n⚠️ WARNING: Force reinstall mode\n'));
156
+ console.log(chalk.red('This will overwrite your existing installation at: ') + chalk.white(existing));
157
+ console.log(chalk.gray('Existing .env file will be backed up automatically\n'));
144
158
  }
145
159
 
146
160
  // Calculate total steps
@@ -262,7 +262,7 @@ export async function update(options) {
262
262
 
263
263
  // Calculate total steps dynamically
264
264
  let totalSteps = 6; // Base steps: check services, pull, stop, start, backend health, migrations
265
- if (!options.skipBackup) totalSteps++; // Backup step
265
+ if (!options.skipBackup) totalSteps += 2; // Pre-start + backup steps
266
266
  if (hasNewServices) totalSteps++; // Install new services step
267
267
  if (hasGateApp || missingServices.gateApp) totalSteps++; // Gate App health check
268
268
  if (hasGuardianApp || missingServices.guardianApp) totalSteps++; // Guardian App health check
@@ -272,6 +272,7 @@ export async function update(options) {
272
272
 
273
273
  // Pre-calculate step numbers for each task (fixes step numbering bug)
274
274
  let currentStep = 0;
275
+ const stepPreStart = !options.skipBackup ? ++currentStep : null;
275
276
  const stepBackup = !options.skipBackup ? ++currentStep : null;
276
277
  const stepCheckServices = ++currentStep;
277
278
  const stepInstallServices = hasNewServices ? ++currentStep : null;
@@ -287,6 +288,19 @@ export async function update(options) {
287
288
  const stepCleanup = !options.skipCleanup ? ++currentStep : null;
288
289
 
289
290
  const tasks = new Listr([
291
+ {
292
+ title: stepPreStart ? formatStepTitle(stepPreStart, totalSteps, 'Starting services for backup') : '',
293
+ skip: () => !stepPreStart ? 'Backup skipped' : false,
294
+ task: async () => {
295
+ await startServicesSilent(composeFile);
296
+
297
+ // Wait for PostgreSQL to be ready (shorter timeout since already installed)
298
+ const healthy = await waitForServiceHealthy(composeFile, 'postgres', 30);
299
+ if (!healthy) {
300
+ throw new Error('PostgreSQL did not become healthy within 30 seconds');
301
+ }
302
+ }
303
+ },
290
304
  {
291
305
  title: stepBackup ? formatStepTitle(stepBackup, totalSteps, 'Creating backup') : '',
292
306
  skip: () => !stepBackup ? 'Backup skipped' : false,