@_xtribe/cli 2.2.34 → 2.2.35

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/install-tribe.js +28 -0
  2. package/package.json +1 -1
package/install-tribe.js CHANGED
@@ -84,6 +84,9 @@ async function installTribeCLI() {
84
84
  const spinner = ora(exists ? 'Updating CLI...' : 'Installing CLI...').start();
85
85
 
86
86
  try {
87
+ // Clean up any existing tribe binaries first
88
+ cleanupExistingTribeBinaries();
89
+
87
90
  // Remove existing if present
88
91
  if (exists) {
89
92
  fs.unlinkSync(tribeDest);
@@ -113,6 +116,28 @@ async function installTribeCLI() {
113
116
  }
114
117
  }
115
118
 
119
+ function cleanupExistingTribeBinaries() {
120
+ const locations = [
121
+ // Current working directory
122
+ path.join(process.cwd(), 'tribe'),
123
+ // Common locations where users might have built/installed tribe
124
+ path.join(homeDir, 'tribe'),
125
+ path.join(homeDir, 'go', 'bin', 'tribe'),
126
+ '/usr/local/bin/tribe',
127
+ '/usr/bin/tribe'
128
+ ];
129
+
130
+ for (const location of locations) {
131
+ try {
132
+ if (fs.existsSync(location)) {
133
+ fs.unlinkSync(location);
134
+ }
135
+ } catch (err) {
136
+ // Ignore permission errors for system locations
137
+ }
138
+ }
139
+ }
140
+
116
141
  async function installTribeCLIQuiet() {
117
142
  const tribeDest = path.join(tribeBinDir, 'tribe');
118
143
 
@@ -120,6 +145,9 @@ async function installTribeCLIQuiet() {
120
145
  const exists = fs.existsSync(tribeDest);
121
146
 
122
147
  try {
148
+ // Clean up any existing tribe binaries first
149
+ cleanupExistingTribeBinaries();
150
+
123
151
  // Remove existing if present
124
152
  if (exists) {
125
153
  fs.unlinkSync(tribeDest);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@_xtribe/cli",
3
- "version": "2.2.34",
3
+ "version": "2.2.35",
4
4
  "description": "TRIBE - Privacy-first AI development analytics. Self-host your telemetry, skip authentication, or run completely offline. Your data stays on your machine.",
5
5
  "main": "install-tribe.js",
6
6
  "bin": {