tr200 2.0.6 → 2.0.7
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/tr200.js +29 -7
- package/package.json +1 -1
package/bin/tr200.js
CHANGED
|
@@ -92,7 +92,7 @@ function cleanProfileFile(filePath) {
|
|
|
92
92
|
return false;
|
|
93
93
|
}
|
|
94
94
|
|
|
95
|
-
// Shell profile paths
|
|
95
|
+
// Shell profile paths for INSTALLATION (minimal set to avoid duplicates)
|
|
96
96
|
function getProfilePaths() {
|
|
97
97
|
if (isWindows) {
|
|
98
98
|
return [
|
|
@@ -114,6 +114,25 @@ function getProfilePaths() {
|
|
|
114
114
|
}
|
|
115
115
|
}
|
|
116
116
|
|
|
117
|
+
// ALL profile paths for CLEANUP (removes duplicates from old installs)
|
|
118
|
+
function getAllProfilePaths() {
|
|
119
|
+
if (isWindows) {
|
|
120
|
+
return [
|
|
121
|
+
path.join(homeDir, 'Documents', 'PowerShell', 'Microsoft.PowerShell_profile.ps1'),
|
|
122
|
+
path.join(homeDir, 'Documents', 'WindowsPowerShell', 'Microsoft.PowerShell_profile.ps1')
|
|
123
|
+
];
|
|
124
|
+
} else {
|
|
125
|
+
// Clean ALL Unix profile files regardless of OS
|
|
126
|
+
return [
|
|
127
|
+
path.join(homeDir, '.bashrc'),
|
|
128
|
+
path.join(homeDir, '.zshrc'),
|
|
129
|
+
path.join(homeDir, '.profile'),
|
|
130
|
+
path.join(homeDir, '.bash_profile'),
|
|
131
|
+
path.join(homeDir, '.zprofile')
|
|
132
|
+
];
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
|
|
117
136
|
// Prompt user for confirmation
|
|
118
137
|
function askConfirmation(question) {
|
|
119
138
|
return new Promise((resolve) => {
|
|
@@ -160,10 +179,12 @@ async function installAutoRun() {
|
|
|
160
179
|
process.exit(0);
|
|
161
180
|
}
|
|
162
181
|
|
|
163
|
-
// First, clean up any existing TR-100/TR-200 configurations
|
|
164
|
-
|
|
182
|
+
// First, clean up any existing TR-100/TR-200 configurations from ALL profiles
|
|
183
|
+
// This removes duplicates from old installs that used multiple profile files
|
|
184
|
+
console.log('Cleaning previous installations from all profiles...');
|
|
185
|
+
const allProfiles = getAllProfilePaths();
|
|
165
186
|
let cleaned = 0;
|
|
166
|
-
for (const profilePath of
|
|
187
|
+
for (const profilePath of allProfiles) {
|
|
167
188
|
if (cleanProfileFile(profilePath)) {
|
|
168
189
|
console.log(` [cleaned] ${profilePath}`);
|
|
169
190
|
cleaned++;
|
|
@@ -213,7 +234,8 @@ async function installAutoRun() {
|
|
|
213
234
|
|
|
214
235
|
// Uninstall auto-run from shell profiles
|
|
215
236
|
async function uninstallAutoRun() {
|
|
216
|
-
|
|
237
|
+
// Use ALL profiles for uninstall to ensure complete cleanup
|
|
238
|
+
const profiles = getAllProfilePaths();
|
|
217
239
|
|
|
218
240
|
console.log('\nTR-200 Machine Report - Remove Auto-Run\n');
|
|
219
241
|
console.log('This will remove ALL TR-100/TR-200 configurations from your shell profile(s).');
|
|
@@ -343,7 +365,7 @@ function runReport() {
|
|
|
343
365
|
// Handle help flag
|
|
344
366
|
if (process.argv.includes('--help') || process.argv.includes('-h')) {
|
|
345
367
|
console.log(`
|
|
346
|
-
TR-200 Machine Report v2.0.
|
|
368
|
+
TR-200 Machine Report v2.0.7
|
|
347
369
|
|
|
348
370
|
Usage: tr200 [options]
|
|
349
371
|
report [options]
|
|
@@ -363,7 +385,7 @@ More info: https://github.com/RealEmmettS/usgc-machine-report
|
|
|
363
385
|
|
|
364
386
|
// Handle version flag
|
|
365
387
|
if (process.argv.includes('--version') || process.argv.includes('-v')) {
|
|
366
|
-
console.log('2.0.
|
|
388
|
+
console.log('2.0.7');
|
|
367
389
|
process.exit(0);
|
|
368
390
|
}
|
|
369
391
|
|