smoonb 0.0.65 → 0.0.66

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "smoonb",
3
- "version": "0.0.65",
3
+ "version": "0.0.66",
4
4
  "description": "Complete Supabase backup and migration tool - EXPERIMENTAL VERSION - USE AT YOUR OWN RISK",
5
5
  "preferGlobal": false,
6
6
  "preventGlobalInstall": true,
@@ -31,10 +31,24 @@ module.exports = async (backupPath) => {
31
31
 
32
32
  // Storage Buckets
33
33
  const storageDir = path.join(backupPath, 'storage');
34
- const storageZipFiles = fs.readdirSync(backupPath).filter(f => f.endsWith('.storage.zip'));
34
+ let storageZipFiles = [];
35
+
36
+ // Verificar se o diretório existe e listar arquivos
37
+ try {
38
+ if (fs.existsSync(backupPath)) {
39
+ const files = fs.readdirSync(backupPath);
40
+ storageZipFiles = files.filter(f => f.endsWith('.storage.zip'));
41
+ }
42
+ } catch {
43
+ // Ignorar erro ao ler diretório
44
+ storageZipFiles = [];
45
+ }
46
+
35
47
  let restoreStorage = false;
48
+ const hasStorageDir = fs.existsSync(storageDir);
49
+ const hasStorageFiles = hasStorageDir && fs.readdirSync(storageDir).length > 0;
36
50
 
37
- if (storageZipFiles.length > 0 || (fs.existsSync(storageDir) && fs.readdirSync(storageDir).length > 0)) {
51
+ if (storageZipFiles.length > 0 || hasStorageFiles) {
38
52
  console.log(chalk.cyan('\n📦 Storage:'));
39
53
  if (storageZipFiles.length > 0) {
40
54
  console.log(chalk.white(` Arquivo .storage.zip encontrado: ${storageZipFiles[0]}`));