zuppaclaude 1.3.8 → 1.3.9
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/lib/settings.js +18 -11
- package/lib/uninstaller.js +3 -2
- package/package.json +1 -1
package/lib/settings.js
CHANGED
|
@@ -210,7 +210,7 @@ class Settings {
|
|
|
210
210
|
}
|
|
211
211
|
|
|
212
212
|
/**
|
|
213
|
-
* Reset settings
|
|
213
|
+
* Reset settings (with confirmation prompt)
|
|
214
214
|
*/
|
|
215
215
|
async reset() {
|
|
216
216
|
if (!this.exists()) {
|
|
@@ -226,17 +226,24 @@ class Settings {
|
|
|
226
226
|
return false;
|
|
227
227
|
}
|
|
228
228
|
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
const backupPath = `${this.filePath}.backup.${timestamp}`;
|
|
232
|
-
fs.copyFileSync(this.filePath, backupPath);
|
|
233
|
-
this.logger.info(`Settings backed up to: ${backupPath}`);
|
|
229
|
+
return this.delete();
|
|
230
|
+
}
|
|
234
231
|
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
232
|
+
/**
|
|
233
|
+
* Delete settings file (no confirmation)
|
|
234
|
+
*/
|
|
235
|
+
delete() {
|
|
236
|
+
if (!this.exists()) {
|
|
237
|
+
return true;
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
try {
|
|
241
|
+
fs.unlinkSync(this.filePath);
|
|
242
|
+
return true;
|
|
243
|
+
} catch (error) {
|
|
244
|
+
this.logger.warning(`Could not delete settings: ${error.message}`);
|
|
245
|
+
return false;
|
|
246
|
+
}
|
|
240
247
|
}
|
|
241
248
|
}
|
|
242
249
|
|
package/lib/uninstaller.js
CHANGED
|
@@ -66,8 +66,9 @@ class Uninstaller {
|
|
|
66
66
|
|
|
67
67
|
// Handle settings
|
|
68
68
|
if (!preserveSettings) {
|
|
69
|
-
this.settings.
|
|
70
|
-
|
|
69
|
+
if (this.settings.delete()) {
|
|
70
|
+
this.logger.success('Settings removed');
|
|
71
|
+
}
|
|
71
72
|
} else {
|
|
72
73
|
this.logger.info('Settings preserved for future reinstall');
|
|
73
74
|
}
|