replit-tools 1.1.1 → 1.1.2

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/index.js CHANGED
@@ -350,6 +350,28 @@ function main() {
350
350
  } else {
351
351
  const version = claudeVersions.sort().pop() || 'installed';
352
352
  console.log(`✅ Claude Code already installed (${version})`);
353
+
354
+ // Ensure binary is in our versions directory
355
+ const defaultVersionsDir = path.join(HOME, '.local/share/claude/versions');
356
+ const sourceDirs = [defaultVersionsDir, oldLocations.versions];
357
+
358
+ for (const sourceDir of sourceDirs) {
359
+ try {
360
+ if (fs.existsSync(sourceDir)) {
361
+ const versions = fs.readdirSync(sourceDir).filter(f => !f.startsWith('.'));
362
+ versions.forEach(v => {
363
+ const src = path.join(sourceDir, v);
364
+ const dest = path.join(claudeVersionsDir, v);
365
+ if (!fs.existsSync(dest) && fs.existsSync(src)) {
366
+ try {
367
+ fs.copyFileSync(src, dest);
368
+ fs.chmodSync(dest, '755');
369
+ } catch {}
370
+ }
371
+ });
372
+ }
373
+ } catch {}
374
+ }
353
375
  }
354
376
 
355
377
  // ═══════════════════════════════════════════════════════════════════
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "replit-tools",
3
- "version": "1.1.1",
3
+ "version": "1.1.2",
4
4
  "description": "DATA Tools - One command to set up Claude Code and Codex CLI on Replit with full persistence",
5
5
  "main": "index.js",
6
6
  "bin": {
@@ -71,6 +71,21 @@ fi
71
71
  # =============================================================================
72
72
  # Step 4: Find latest Claude version and create binary symlink
73
73
  # =============================================================================
74
+
75
+ # First, sync any versions from default location to our directory
76
+ DEFAULT_VERSIONS="${HOME}/.local/share/claude/versions"
77
+ if [ -d "${DEFAULT_VERSIONS}" ]; then
78
+ for version_file in "${DEFAULT_VERSIONS}"/*; do
79
+ if [ -f "${version_file}" ]; then
80
+ version_name=$(basename "${version_file}")
81
+ if [ ! -f "${CLAUDE_VERSIONS}/${version_name}" ]; then
82
+ cp -p "${version_file}" "${CLAUDE_VERSIONS}/${version_name}" 2>/dev/null || true
83
+ chmod 755 "${CLAUDE_VERSIONS}/${version_name}" 2>/dev/null || true
84
+ fi
85
+ fi
86
+ done
87
+ fi
88
+
74
89
  LATEST_VERSION=""
75
90
  if [ -d "${CLAUDE_VERSIONS}" ]; then
76
91
  LATEST_VERSION=$(ls -1 "${CLAUDE_VERSIONS}" 2>/dev/null | grep -v '^\.' | sort -V | tail -n1)
@@ -92,7 +107,6 @@ else
92
107
  # Install Claude Code using the official installer
93
108
  if curl -fsSL https://claude.ai/install.sh | bash 2>/dev/null; then
94
109
  # After install, copy to our versions directory
95
- DEFAULT_VERSIONS="${HOME}/.local/share/claude/versions"
96
110
  if [ -d "${DEFAULT_VERSIONS}" ]; then
97
111
  LATEST_VERSION=$(ls -1 "${DEFAULT_VERSIONS}" 2>/dev/null | grep -v '^\.' | sort -V | tail -n1)
98
112
  if [ -n "${LATEST_VERSION}" ]; then