tr200 2.0.4 → 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.
Files changed (2) hide show
  1. package/bin/tr200.js +34 -11
  2. 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 [
@@ -100,15 +100,35 @@ function getProfilePaths() {
100
100
  path.join(homeDir, 'Documents', 'WindowsPowerShell', 'Microsoft.PowerShell_profile.ps1')
101
101
  ];
102
102
  } else if (isMac) {
103
+ // macOS: only .zshrc needed (zsh is default since Catalina)
104
+ // SSH login sources .zshrc for interactive sessions
103
105
  return [
104
- path.join(homeDir, '.zshrc'),
105
- path.join(homeDir, '.bash_profile')
106
+ path.join(homeDir, '.zshrc')
106
107
  ];
107
108
  } else {
108
- // Linux/BSD
109
+ // Linux/BSD - only .bashrc needed
110
+ // .profile sources .bashrc on most distros, so adding to both causes duplicates
111
+ return [
112
+ path.join(homeDir, '.bashrc')
113
+ ];
114
+ }
115
+ }
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
109
126
  return [
110
127
  path.join(homeDir, '.bashrc'),
111
- path.join(homeDir, '.profile')
128
+ path.join(homeDir, '.zshrc'),
129
+ path.join(homeDir, '.profile'),
130
+ path.join(homeDir, '.bash_profile'),
131
+ path.join(homeDir, '.zprofile')
112
132
  ];
113
133
  }
114
134
  }
@@ -159,10 +179,12 @@ async function installAutoRun() {
159
179
  process.exit(0);
160
180
  }
161
181
 
162
- // First, clean up any existing TR-100/TR-200 configurations
163
- console.log('Cleaning previous installations...');
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();
164
186
  let cleaned = 0;
165
- for (const profilePath of profiles) {
187
+ for (const profilePath of allProfiles) {
166
188
  if (cleanProfileFile(profilePath)) {
167
189
  console.log(` [cleaned] ${profilePath}`);
168
190
  cleaned++;
@@ -212,7 +234,8 @@ async function installAutoRun() {
212
234
 
213
235
  // Uninstall auto-run from shell profiles
214
236
  async function uninstallAutoRun() {
215
- const profiles = getProfilePaths();
237
+ // Use ALL profiles for uninstall to ensure complete cleanup
238
+ const profiles = getAllProfilePaths();
216
239
 
217
240
  console.log('\nTR-200 Machine Report - Remove Auto-Run\n');
218
241
  console.log('This will remove ALL TR-100/TR-200 configurations from your shell profile(s).');
@@ -342,7 +365,7 @@ function runReport() {
342
365
  // Handle help flag
343
366
  if (process.argv.includes('--help') || process.argv.includes('-h')) {
344
367
  console.log(`
345
- TR-200 Machine Report v2.0.4
368
+ TR-200 Machine Report v2.0.7
346
369
 
347
370
  Usage: tr200 [options]
348
371
  report [options]
@@ -362,7 +385,7 @@ More info: https://github.com/RealEmmettS/usgc-machine-report
362
385
 
363
386
  // Handle version flag
364
387
  if (process.argv.includes('--version') || process.argv.includes('-v')) {
365
- console.log('2.0.4');
388
+ console.log('2.0.7');
366
389
  process.exit(0);
367
390
  }
368
391
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tr200",
3
- "version": "2.0.4",
3
+ "version": "2.0.7",
4
4
  "description": "Cross-platform system information report with Unicode box-drawing display",
5
5
  "author": "shaughv",
6
6
  "license": "BSD-3-Clause",