smoonb 0.0.37 → 0.0.38
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/package.json +1 -1
- package/src/commands/backup.js +10 -28
package/package.json
CHANGED
package/src/commands/backup.js
CHANGED
|
@@ -425,41 +425,23 @@ async function backupEdgeFunctionsWithDocker(projectId, accessToken, backupDir)
|
|
|
425
425
|
|
|
426
426
|
// Baixar Edge Function via Supabase CLI DIRETAMENTE para o backup
|
|
427
427
|
const { execSync } = require('child_process');
|
|
428
|
-
const tempBackupDir = path.join(backupDir, 'temp-supabase-download');
|
|
429
428
|
|
|
430
|
-
//
|
|
431
|
-
await ensureDir(tempBackupDir);
|
|
432
|
-
|
|
433
|
-
// Download para diretório temporário
|
|
429
|
+
// Download DIRETO para o diretório de destino (sem intermediários)
|
|
434
430
|
execSync(`supabase functions download ${func.name}`, {
|
|
435
|
-
cwd:
|
|
431
|
+
cwd: functionTargetDir,
|
|
436
432
|
timeout: 60000,
|
|
437
433
|
stdio: 'pipe'
|
|
438
434
|
});
|
|
439
435
|
|
|
440
|
-
|
|
441
|
-
|
|
436
|
+
console.log(chalk.green(` ✅ ${func.name} baixada com sucesso`));
|
|
437
|
+
successCount++;
|
|
442
438
|
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
await fs.rm(tempBackupDir, { recursive: true, force: true }).catch(() => {});
|
|
450
|
-
|
|
451
|
-
console.log(chalk.green(` ✅ ${func.name} baixada com sucesso`));
|
|
452
|
-
successCount++;
|
|
453
|
-
|
|
454
|
-
downloadedFunctions.push({
|
|
455
|
-
name: func.name,
|
|
456
|
-
slug: func.name,
|
|
457
|
-
version: func.version || 'unknown',
|
|
458
|
-
files: await fs.readdir(functionTargetDir).catch(() => [])
|
|
459
|
-
});
|
|
460
|
-
} catch (innerError) {
|
|
461
|
-
throw new Error('Diretório não encontrado após download');
|
|
462
|
-
}
|
|
439
|
+
downloadedFunctions.push({
|
|
440
|
+
name: func.name,
|
|
441
|
+
slug: func.name,
|
|
442
|
+
version: func.version || 'unknown',
|
|
443
|
+
files: await fs.readdir(functionTargetDir).catch(() => [])
|
|
444
|
+
});
|
|
463
445
|
|
|
464
446
|
} catch (error) {
|
|
465
447
|
console.log(chalk.yellow(` ⚠️ Erro ao baixar ${func.name}: ${error.message}`));
|