olly-molly 0.1.12 → 0.1.14

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.
Files changed (2) hide show
  1. package/bin/cli.js +39 -12
  2. package/package.json +1 -1
package/bin/cli.js CHANGED
@@ -59,25 +59,52 @@ function getLocalVersion() {
59
59
  } catch { return null; }
60
60
  }
61
61
 
62
- function backupDB() {
63
- const backupDir = path.join(os.tmpdir(), 'olly-molly-db-backup');
62
+ const CUSTOM_PROFILES_DIR = path.join(APP_DIR, 'custom-profiles');
63
+
64
+ function backupUserData() {
65
+ const backupDir = path.join(os.tmpdir(), 'olly-molly-backup');
66
+ fs.mkdirSync(backupDir, { recursive: true });
67
+
68
+ // Backup database
64
69
  if (fs.existsSync(DB_DIR)) {
65
- fs.cpSync(DB_DIR, backupDir, { recursive: true });
66
- return backupDir;
70
+ const dbBackupDir = path.join(backupDir, 'db');
71
+ fs.cpSync(DB_DIR, dbBackupDir, { recursive: true });
72
+ }
73
+
74
+ // Backup custom profile images
75
+ if (fs.existsSync(CUSTOM_PROFILES_DIR)) {
76
+ const profilesBackupDir = path.join(backupDir, 'custom-profiles');
77
+ fs.cpSync(CUSTOM_PROFILES_DIR, profilesBackupDir, { recursive: true });
67
78
  }
68
- return null;
79
+
80
+ return backupDir;
69
81
  }
70
82
 
71
- function restoreDB(backupDir) {
72
- if (backupDir && fs.existsSync(backupDir)) {
83
+ function restoreUserData(backupDir) {
84
+ if (!backupDir || !fs.existsSync(backupDir)) return;
85
+
86
+ // Restore database
87
+ const dbBackupDir = path.join(backupDir, 'db');
88
+ if (fs.existsSync(dbBackupDir)) {
73
89
  fs.mkdirSync(DB_DIR, { recursive: true });
74
- for (const file of fs.readdirSync(backupDir)) {
90
+ for (const file of fs.readdirSync(dbBackupDir)) {
75
91
  if (file.includes('.sqlite')) {
76
- fs.copyFileSync(path.join(backupDir, file), path.join(DB_DIR, file));
92
+ fs.copyFileSync(path.join(dbBackupDir, file), path.join(DB_DIR, file));
77
93
  }
78
94
  }
79
- fs.rmSync(backupDir, { recursive: true, force: true });
80
95
  }
96
+
97
+ // Restore custom profile images
98
+ const profilesBackupDir = path.join(backupDir, 'custom-profiles');
99
+ if (fs.existsSync(profilesBackupDir)) {
100
+ fs.mkdirSync(CUSTOM_PROFILES_DIR, { recursive: true });
101
+ for (const file of fs.readdirSync(profilesBackupDir)) {
102
+ fs.copyFileSync(path.join(profilesBackupDir, file), path.join(CUSTOM_PROFILES_DIR, file));
103
+ }
104
+ }
105
+
106
+ // Clean up backup
107
+ fs.rmSync(backupDir, { recursive: true, force: true });
81
108
  }
82
109
 
83
110
  async function main() {
@@ -90,12 +117,12 @@ async function main() {
90
117
  // Update if npm version is newer
91
118
  if (localVersion && npmVersion && localVersion !== npmVersion) {
92
119
  console.log(`🔄 Updating ${localVersion} → ${npmVersion}\n`);
93
- const dbBackup = backupDB();
120
+ const userDataBackup = backupUserData();
94
121
  fs.rmSync(APP_DIR, { recursive: true, force: true });
95
122
  console.log('📥 Downloading...');
96
123
  await download(TARBALL_URL, APP_DIR);
97
124
  console.log('✅ Downloaded\n');
98
- restoreDB(dbBackup);
125
+ restoreUserData(userDataBackup);
99
126
  needsInstall = true;
100
127
  needsBuild = true;
101
128
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "olly-molly",
3
- "version": "0.1.12",
3
+ "version": "0.1.14",
4
4
  "description": "Your AI Development Team, Running Locally - Manage AI agents (PM, Frontend, Backend, QA) from a beautiful kanban board",
5
5
  "keywords": [
6
6
  "ai",