mailos 0.1.54 → 0.1.58
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/mailos-darwin-amd64
CHANGED
|
Binary file
|
package/bin/mailos-darwin-arm64
CHANGED
|
Binary file
|
package/bin/mailos-linux-amd64
CHANGED
|
Binary file
|
package/bin/mailos-linux-arm64
CHANGED
|
Binary file
|
|
Binary file
|
package/package.json
CHANGED
package/scripts/uninstall.js
CHANGED
|
@@ -2,11 +2,16 @@
|
|
|
2
2
|
|
|
3
3
|
const fs = require('fs');
|
|
4
4
|
const path = require('path');
|
|
5
|
+
const os = require('os');
|
|
6
|
+
const readline = require('readline');
|
|
5
7
|
|
|
6
8
|
const binPath = path.join(__dirname, '..', 'bin', 'mailos');
|
|
7
9
|
const binPathWin = path.join(__dirname, '..', 'bin', 'mailos.exe');
|
|
8
10
|
|
|
9
|
-
console.log('
|
|
11
|
+
console.log('🗑️ EmailOS Uninstallation');
|
|
12
|
+
console.log('========================');
|
|
13
|
+
console.log();
|
|
14
|
+
console.log('Removing EmailOS binary...');
|
|
10
15
|
|
|
11
16
|
try {
|
|
12
17
|
if (fs.existsSync(binPath)) {
|
|
@@ -15,7 +20,126 @@ try {
|
|
|
15
20
|
if (fs.existsSync(binPathWin)) {
|
|
16
21
|
fs.unlinkSync(binPathWin);
|
|
17
22
|
}
|
|
18
|
-
console.log('✓
|
|
23
|
+
console.log('✓ Binary removed');
|
|
19
24
|
} catch (error) {
|
|
20
|
-
console.error('
|
|
25
|
+
console.error('Binary cleanup failed:', error.message);
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
// Check for EmailOS data
|
|
29
|
+
const homeDir = os.homedir();
|
|
30
|
+
const emailDir = path.join(homeDir, '.email');
|
|
31
|
+
|
|
32
|
+
if (fs.existsSync(emailDir)) {
|
|
33
|
+
console.log();
|
|
34
|
+
console.log('⚠️ EmailOS Data Detected');
|
|
35
|
+
console.log('========================');
|
|
36
|
+
console.log();
|
|
37
|
+
console.log('EmailOS configuration and email data was found at:');
|
|
38
|
+
console.log(` ${emailDir}`);
|
|
39
|
+
console.log();
|
|
40
|
+
console.log('This directory contains:');
|
|
41
|
+
console.log('• Your email account configuration (including app passwords)');
|
|
42
|
+
console.log('• All synced email data (sent, received, drafts)');
|
|
43
|
+
console.log('• License information');
|
|
44
|
+
console.log();
|
|
45
|
+
console.log('⚠️ This data will NOT be automatically removed!');
|
|
46
|
+
console.log();
|
|
47
|
+
console.log('To completely remove EmailOS and all data:');
|
|
48
|
+
console.log(' 1. Keep the data and remove it manually later:');
|
|
49
|
+
console.log(` rm -rf "${emailDir}"`);
|
|
50
|
+
console.log();
|
|
51
|
+
console.log(' 2. Or use the EmailOS cleanup command (if still available):');
|
|
52
|
+
console.log(' mailos uninstall --backup');
|
|
53
|
+
console.log();
|
|
54
|
+
|
|
55
|
+
// Try to run cleanup if mailos is still available
|
|
56
|
+
if (process.platform !== 'win32') {
|
|
57
|
+
try {
|
|
58
|
+
const { execSync } = require('child_process');
|
|
59
|
+
console.log('Attempting automatic cleanup...');
|
|
60
|
+
|
|
61
|
+
// Try to run mailos cleanup
|
|
62
|
+
try {
|
|
63
|
+
execSync('mailos cleanup 2>/dev/null', { stdio: 'ignore' });
|
|
64
|
+
console.log('✓ EmailOS cleanup completed automatically.');
|
|
65
|
+
} catch (cleanupError) {
|
|
66
|
+
// mailos command not found or failed, show manual instructions
|
|
67
|
+
promptManualCleanup();
|
|
68
|
+
}
|
|
69
|
+
} catch (error) {
|
|
70
|
+
promptManualCleanup();
|
|
71
|
+
}
|
|
72
|
+
} else {
|
|
73
|
+
promptManualCleanup();
|
|
74
|
+
}
|
|
75
|
+
} else {
|
|
76
|
+
console.log('✓ No EmailOS data found to clean up.');
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
console.log();
|
|
80
|
+
console.log('📦 npm uninstall completed.');
|
|
81
|
+
console.log();
|
|
82
|
+
console.log('Thank you for using EmailOS! 👋');
|
|
83
|
+
|
|
84
|
+
function promptManualCleanup() {
|
|
85
|
+
const rl = readline.createInterface({
|
|
86
|
+
input: process.stdin,
|
|
87
|
+
output: process.stdout
|
|
88
|
+
});
|
|
89
|
+
|
|
90
|
+
console.log();
|
|
91
|
+
rl.question('Would you like to remove EmailOS data now? (y/N): ', (answer) => {
|
|
92
|
+
const response = answer.trim().toLowerCase();
|
|
93
|
+
|
|
94
|
+
if (response === 'y' || response === 'yes') {
|
|
95
|
+
try {
|
|
96
|
+
// Create backup first
|
|
97
|
+
const backupDir = path.join(homeDir, 'Downloads', `emailos-backup-${new Date().toISOString().split('T')[0]}`);
|
|
98
|
+
console.log(`Creating backup at: ${backupDir}`);
|
|
99
|
+
|
|
100
|
+
if (!fs.existsSync(backupDir)) {
|
|
101
|
+
fs.mkdirSync(backupDir, { recursive: true });
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
// Copy .email directory to backup
|
|
105
|
+
copyDir(emailDir, path.join(backupDir, '.email'));
|
|
106
|
+
console.log('✓ Backup created');
|
|
107
|
+
|
|
108
|
+
// Remove original directory
|
|
109
|
+
fs.rmSync(emailDir, { recursive: true, force: true });
|
|
110
|
+
console.log('✓ EmailOS data removed');
|
|
111
|
+
console.log(`💾 Backup available at: ${backupDir}`);
|
|
112
|
+
} catch (error) {
|
|
113
|
+
console.error(`❌ Failed to remove EmailOS data: ${error.message}`);
|
|
114
|
+
console.log();
|
|
115
|
+
console.log('You can manually remove the data with:');
|
|
116
|
+
console.log(` rm -rf "${emailDir}"`);
|
|
117
|
+
}
|
|
118
|
+
} else {
|
|
119
|
+
console.log('EmailOS data preserved.');
|
|
120
|
+
console.log('You can remove it later with:');
|
|
121
|
+
console.log(` rm -rf "${emailDir}"`);
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
rl.close();
|
|
125
|
+
});
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
function copyDir(src, dest) {
|
|
129
|
+
if (!fs.existsSync(dest)) {
|
|
130
|
+
fs.mkdirSync(dest, { recursive: true });
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
const entries = fs.readdirSync(src, { withFileTypes: true });
|
|
134
|
+
|
|
135
|
+
for (const entry of entries) {
|
|
136
|
+
const srcPath = path.join(src, entry.name);
|
|
137
|
+
const destPath = path.join(dest, entry.name);
|
|
138
|
+
|
|
139
|
+
if (entry.isDirectory()) {
|
|
140
|
+
copyDir(srcPath, destPath);
|
|
141
|
+
} else {
|
|
142
|
+
fs.copyFileSync(srcPath, destPath);
|
|
143
|
+
}
|
|
144
|
+
}
|
|
21
145
|
}
|