osborn 0.9.164 → 0.9.166
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/cli.js +18 -2
- package/package.json +1 -1
package/bin/cli.js
CHANGED
|
@@ -3,7 +3,24 @@
|
|
|
3
3
|
import { spawn } from 'child_process'
|
|
4
4
|
import { fileURLToPath } from 'url'
|
|
5
5
|
import { dirname, join } from 'path'
|
|
6
|
-
import { readFileSync } from 'fs'
|
|
6
|
+
import { readFileSync, existsSync, lstatSync, symlinkSync } from 'fs'
|
|
7
|
+
import os from 'os'
|
|
8
|
+
|
|
9
|
+
// On Fly machines, home is /root (ephemeral) but sessions live on /workspace/.claude.
|
|
10
|
+
// Recreate the symlink on every startup so sessions survive image updates.
|
|
11
|
+
try {
|
|
12
|
+
const home = os.homedir()
|
|
13
|
+
const target = '/workspace/.claude'
|
|
14
|
+
const link = join(home, '.claude')
|
|
15
|
+
if (existsSync(target) && home !== '/workspace') {
|
|
16
|
+
let needsLink = true
|
|
17
|
+
try {
|
|
18
|
+
const stat = lstatSync(link)
|
|
19
|
+
needsLink = !stat.isSymbolicLink()
|
|
20
|
+
} catch {}
|
|
21
|
+
if (needsLink) symlinkSync(target, link)
|
|
22
|
+
}
|
|
23
|
+
} catch {}
|
|
7
24
|
|
|
8
25
|
const __filename = fileURLToPath(import.meta.url)
|
|
9
26
|
const __dirname = dirname(__filename)
|
|
@@ -69,7 +86,6 @@ if (args.includes('start')) {
|
|
|
69
86
|
}
|
|
70
87
|
|
|
71
88
|
// Use src/index.ts (dev) if available, otherwise dist/index.js (npm install)
|
|
72
|
-
import { existsSync } from 'fs'
|
|
73
89
|
const srcPath = join(__dirname, '..', 'src', 'index.ts')
|
|
74
90
|
const distPath = join(__dirname, '..', 'dist', 'index.js')
|
|
75
91
|
|